dc7a9163d9 dc7a9163d9 - 6 months ago 49
AngularJS Question

Run angular-seed project inside of visual studio?

I've created an Angularjs app by cloning the angular-seed.

git clone --depth=1 https://github.com/angular/angular-seed.git Web
cd Web
npm install

Then the app can be started by running
npm start

I tried to create a new project and selected template "Javascript -> Node.js -> From Existing Node.js code". Then I set the start js file to
. However, running (debug) the app got the following error?

Debugger listening on [::]:5858
angular.module('myApp', [

ReferenceError: angular is not defined
at Object. (D:\....\Web\app\app.js:4:1)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Timeout.Module.runMain [as _onTimeout] (module.js:590:10)
at tryOnTimeout (timers.js:232:11)
at Timer.listOnTimeout (timers.js:202:5)
Press any key to continue...

I need to deploy the angular app on nodejs. How to create an angular project run on node?


I think your getting confused as Angular will not run directly with node. Just open Visual Studio then select File -> Open -> Website.. then browse to and select your /Web folder.

Once web site is open just make sure app/index.html is selected hit F5. It may ask you to alter web.config to enable debugging - or just if you just want to view it you can right click on index.html and View in browser.