2017年如何使用vscode调试angular 4应用程序的简单示例

2017年如何使用vscode调试angular 4应用程序的简单示例,angular,debugging,typescript,visual-studio-code,Angular,Debugging,Typescript,Visual Studio Code,我使用Vscode,我想修复我应用程序中的一个大问题。解决这个问题的唯一原因是调试我的代码 我从StackOverflow中找到这段代码,如何在vscode中调试angular 4,但不起作用的是不调试任何东西 launch.json 调试控制台 你安装了chrome调试器扩展吗?是的,我几个月前就安装了,但在开发中从未使用过。现在我面临一个问题,我不知道从哪里开始。如果你能给我发送launch.json中的基本工作示例,我很欣赏这个launch.json为我工作(从问题中复制json,然后从答

我使用Vscode,我想修复我应用程序中的一个大问题。解决这个问题的唯一原因是调试我的代码

我从StackOverflow中找到这段代码,如何在vscode中调试angular 4,但不起作用的是不调试任何东西

launch.json 调试控制台
你安装了chrome调试器扩展吗?是的,我几个月前就安装了,但在开发中从未使用过。现在我面临一个问题,我不知道从哪里开始。如果你能给我发送launch.json中的基本工作示例,我很欣赏这个launch.json为我工作(从问题中复制json,然后从答案中替换配置-别忘了填写你自己的localhost项目url)可能与你安装的chrome调试器扩展重复?是,我在几个月前安装过,但从未在开发中使用过,现在我面临一个问题,我不知道从哪里开始。如果你能给我发送launch.json中的基本工作示例,我很欣赏这个launch.json为我工作(从问题中复制json,然后从答案中替换配置-别忘了填写你自己的localhost项目url)的可能副本
    {
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch Chrome against localhost, with sourcemaps",
      "type": "chrome",
      "request": "launch",
      "url": "http://localhost:4200/all-products",
      "sourceMaps": true,
      "diagnosticLogging": true,
      "webRoot": "${workspaceRoot}",
      "userDataDir": "${workspaceRoot}/.vscode/chrome"
    },
    {
      "name": "Attach to Chrome, with sourcemaps",
      "type": "chrome",
      "request": "attach",
      "port": 9222,
      "sourceMaps": true,
      "diagnosticLogging": true,
      "webRoot": "${workspaceRoot}"
    }
  ]
}
Error processing "restart": TypeError: Cannot read property 'Page' of undefined
at ChromeDebugAdapter.restart (C:\Users\Developer.vscode\extensions\msjsdiag.debugger-for-chrome-3.1.5\out\bundle.js:304:27)
at Object.dispatchRequest (C:\Users\Developer.vscode\extensions\msjsdiag.debugger-for-chrome-3.1.5\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugSession.js:75:82)
at Object.ProtocolServer._handleData (C:\Users\Developer.vscode\extensions\msjsdiag.debugger-for-chrome-3.1.5\node_modules\vscode-chrome-debug-core\node_modules\vscode-debugadapter\lib\protocol.js:104:38)
at Socket. (C:\Users\Developer.vscode\extensions\msjsdiag.debugger-for-chrome-3.1.5\node_modules\vscode-chrome-debug-core\node_modules\vscode-debugadapter\lib\protocol.js:24:60)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
Terminated: Got disconnect request
Killing Chrome process by pid: taskkill /F /T /PID 3188