我从https://github.com/DeborahK/Angular-TypeScript下载了代码,然后执行了以下步骤:
4.执行创建用于调试代码的launch.json的步骤
{
"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": "Launch app.ts",
// Type of configuration. Possible values: "node", "mono".
"type": "node",
// Workspace relative or absolute path to the program.
"program": "app/app.ts",
// 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.
"runtimeArgs": ["--nolazy"],
// Environment variables passed to the program.
"env": {
"NODE_ENV": "development"
},
// Use JavaScript source maps (if they exist).
"sourceMaps": true,
// If JavaScript source maps are enabled, the generated code is expected in this directory.
"outDir": null
},
{
"name": "Attach",
"type": "node",
// TCP/IP address. Default is "localhost".
"address": "localhost",
// Port to attach to.
"port": 5858,
"sourceMaps": false
}
]
}
tsconfig.json
{
"compilerOptions": {
"module":"commonjs",
"noImplicitAny": true,
"removeComments": false,
"preserveConstEnums": true,
"target": "ES5",
"sourceMap": true
}
}
我现在按下 Ctrl + Shift + D 命令并尝试调试代码。控件转到 app.ts 文件并在那里停止,但出现以下异常:“未定义角度”
任何人都可以帮助我知道我是否缺少任何东西来解决这个问题。