简体   繁体   English

在Webstorm中设置Angular.js?

[英]Setup Angular.js in Webstorm?

I'm trying to setup a node.js and angular.js project in webstorm but I get this error msg: 我正在尝试在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

I added angular.min.jr as a file to my framework settings and I installed and configured node.js. 我将angular.min.jr作为文件添加到我的框架设置中,并安装并配置了node.js. What should I do to make it run? 我应该怎么做才能让它运行? This is the app.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'
            });
    }]);
    */

In this case, that problem should be related to the order of libs for loading. 在这种情况下,该问题应该与libs的加载顺序有关。 Angular files must be loaded before calling it. 必须在调用之前加载Angular文件。 check this link out 检查此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM