2015-08-30 62 views
3

我試圖建立一個的Node.js和webstorm angular.js項目,但我收到此錯誤信息:在Webstorm中設置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' 
      }); 
    }]); 
    */ 

回答

3

在這種情況下,該問題應該與加載的庫的順序有關。在調用它之前,必須先加載角度文件。檢查這link

+0

@NiklasinStockholm,一個新的鏈接添加到我的答案 –

相關問題