I have been proficient in working with ASP.NET for a number of years, which includes MVC, JavaScript, Visual Studio, and more.
Currently, I am tasked with handling a small project that has been developed using AngularJS. To begin debugging the application, I have installed Visual Studio Code. However, I am unsure about what needs to be included in the launch.json file.
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}\\manager\\angular\\js\\app.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": null
}
]
}
app.js file
// Declare app level module
var main = angular.module('eng-im', [
'ngAnimate',
'ngRoute',
'ngCookies',
'toaster',
'ui.router',
'ui.bootstrap',
'angularSpinner',
'engrafa.directives',
'engrafa.controllers',
'rt.encodeuri',
'searchbar',
'base64'
]);
Upon hitting F5, the debugger begins at the "angular.module()" method but then throws an exception when stepping through it.
> node --debug-brk=40967 --nolazy manager\angular\js\app.js
Debugger listening on port 40967
c:\code\manager\angular\js\app.js:32
var main = angular.module('eng-im', [ ^
ReferenceError: angular is not defined
at Object.<anonymous> (c:\code\manager\angular\js\app.js:32:12)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.runMain [as _onTimeout] (module.js:442:10)
at Timer.listOnTimeout (timers.js:92:15)
Questions
1) The AngularJS application consists of app.js file & index.html file. What should be entered as the value for the "program" property in launch.json?
2) Is there any extension necessary to install for working with AngularJS?