在 Webstorm 中设置 Angular.js?
Setup Angular.js in Webstorm?
我正在尝试在 webstorm 中设置 node.js 和 angular.js 项目,但收到此错误消息:
/usr/bin/node app/src/app.js
/home/dac/WebstormProjects/web-plugin/app/src/app.js:1
ion (exports, require, module, __filename, __dirname) { var myApp = angular.mo
^
ReferenceError: angular is not defined
at Object.<anonymous> (/home/dac/WebstormProjects/web-plugin/app/src/app.js:1:75)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Process finished with exit code 1
我将 angular.min.jr 作为文件添加到我的框架设置中,并安装并配置了 node.js。我应该怎么做才能使它运行?这是 app.js
var myApp = angular.module('AngularChromeEx', []); //"ExecuteScriptService", "SendMessageService"
/*
myApp .config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/browserPopup', {
templateUrl: 'views/PopupView.html',
controller: 'PopupController'
}).
otherwise({
redirectTo: 'views/PopupView.html'
});
}]);
*/
在这种情况下,该问题应该与加载库的顺序有关。 Angular 文件必须在调用前加载。检查此 link
我正在尝试在 webstorm 中设置 node.js 和 angular.js 项目,但收到此错误消息:
/usr/bin/node app/src/app.js
/home/dac/WebstormProjects/web-plugin/app/src/app.js:1
ion (exports, require, module, __filename, __dirname) { var myApp = angular.mo
^
ReferenceError: angular is not defined
at Object.<anonymous> (/home/dac/WebstormProjects/web-plugin/app/src/app.js:1:75)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Process finished with exit code 1
我将 angular.min.jr 作为文件添加到我的框架设置中,并安装并配置了 node.js。我应该怎么做才能使它运行?这是 app.js
var myApp = angular.module('AngularChromeEx', []); //"ExecuteScriptService", "SendMessageService"
/*
myApp .config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/browserPopup', {
templateUrl: 'views/PopupView.html',
controller: 'PopupController'
}).
otherwise({
redirectTo: 'views/PopupView.html'
});
}]);
*/
在这种情况下,该问题应该与加载库的顺序有关。 Angular 文件必须在调用前加载。检查此 link