我有一个使用Angular (angular 1.6)和NodeJS制作的应用程序,我无法将 Angular 库ngResource导入我的应用程序。这些是我所做的步骤:
1:在命令行中我输入npm install --save angular-resource
2:在 app.js 中:
import angular from 'angular';
import ngResource from 'angular-resource';
import uiRouter from 'angular-ui-router';
import Components from './components/components';
angular.module('myApp', [
uiRouter,
Components,
ngResource
])
.component('homePage', HomeComponent)
.service('AirportsService', AirportsService)
.service('CheapFlightService', CheapFlightService)
之后,我在浏览器中收到此错误:
angular-resource.js:444 Uncaught TypeError:
angular.module(...).info 不是函数