Niklas Rosencrantz
Niklas Rosencrantz

Reputation: 26652

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:

/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. What should I do to make it run? This is the 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'
            });
    }]);
    */

Upvotes: 3

Views: 206

Answers (1)

Super Hornet
Super Hornet

Reputation: 2907

In this case, that problem should be related to the order of libs for loading. Angular files must be loaded before calling it. check this link out

Upvotes: 3

Related Questions