I have been building and debugging an Angular.JS application for several months now running from a browser without any issues whatsoever, however I am now in the stages of packaging it to run in node wrapper. When i created my package.json and ran the folder from nw.exe I get an error that says:
Uncaught node.js Error
ReferenceError: angular is not defined
at file:///C:/wamp/www/Maintenence/ng/ng-init.js:2:11
now the code line it has a problem with in ng-init.js is
var app = angular.module('MaintenenceApp', ['ngRoute']);
It doesnt like angular
in angular.module
and once I received this error I went to the angular.js docs to make sure i hadnt done something wrong here and according to https://docs.angularjs.org/guide/module this code is 100% correct.
what could be causing this error. as i mentioned, it runs perfectly in a web browser with no errors in js console.
package.json
{
"main": "index.html",
"name": "Maintenence Manager",
"version": "0.0.1",
"window": {
"toolbar": false,
"frame" : true
}
}
here is the order of my scripts in the head of index.html index.html
<didnt seem important to show css links and such but jquery is also in the page>
<script type="text/javascript" src="//code.angularjs.org/1.3.0-rc.0/angular.js"></script>
<Script type="text/javascript" src="//code.angularjs.org/1.3.0-rc.0/angular-route.js"></Script>
<script type="text/javascript" src="ng/ng-init.js"></script>
Thanks in advance.