Tôi muốn gỡ lỗi App góc của tôi với Visual Studio mới Mã, nhưng Dường như có một vấn đề với góc và Visual Studio Mã ..Visual Studio Mã gỡ lỗi với AngularJS
Đây là launch.json tôi:
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
// ONLY "node" and "mono" are supported, change "type" to switch.
"configurations": [
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "Manager",
// Type of configuration. Possible values: "node", "mono".
"type": "node",
// Workspace relative or absolute path to the program.
"program": "/Volumes/Transcend/WorkArea/Manager/app/app.js",
// Automatically stop program after launch.
"stopOnEntry": true,
// Command line arguments passed to the program.
"args": [],
// Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
"cwd": ".",
// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
"runtimeExecutable": null,
// Optional arguments passed to the runtime executable.
"runtimeArguments": [],
// Environment variables passed to the program.
"env": { },
// Use JavaScript source maps (if they exist).
"sourceMaps": false
},
{
"name": "Attach",
"type": "node",
// TCP/IP address. Default is "localhost".
"address": "localhost",
// Port to attach to.
"port": 5858,
"sourceMaps": false
}
]
}
tôi có lỗi này khi tôi cố gắng để gỡ lỗi ứng dụng kiễu góc của tôi,
lỗi:
ReferenceError: angular is not defined
at Object.<anonymous> (/Volumes/Transcend/WorkArea/Manager/app/app.js:1:79)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain [as _onTimeout] (module.js:497:10)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
MacBook-Pro:Manager user$ cd '/Volumes/Transcend/WorkArea/Manager'; 'node' '--debug-brk=55539' '/Volumes/Transcend/WorkArea/Manager/app/app.js'
debugger listening on port 55539
Killed: 9
app.js
/// <reference path="../typings/angularjs/angular.d.ts"/>
var routerApp = angular.module('uiRouter', ['ui.router', 'uiRouter.dmvs']);
routerApp.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/home');
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'app/dmvs/partial-d.html',
controller:'dController'
})
});
Bạn có thêm thư viện góc để dự án của bạn và bạn đã tham khảo không? –
Thử các giải pháp sau: http://stackoverflow.com/questions/18044519/what-is-the-cause-for-angular-is-not-defined và http://stackoverflow.com/questions/14260399/angularjs-referenceerror -angular-is-not-defined –
Điều này thực sự có thể? Tôi nghĩ rằng một ứng dụng Angular cần thiết để bắt đầu với việc xử lý tệp index.html, cụ thể là chỉ thị ng-app. Tôi không nghĩ rằng nó có thể được bắt đầu từ tệp app.js bằng cách sử dụng node.js? – DeborahK