VSCode调试Angular+TypeScript项目

步骤一:安装Debugger for Chrome插件

步骤二:配置launch.json

"version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Program",
            "type": "chrome",
            "request": "launch",
            "url": "http://localhost:4200",
            "sourceMaps": true,
            "webRoot": "${workspaceRoot}",
            "trace": true,
            "userDataDir": "${workspaceRoot}/.vscode/chrome",
            "runtimeExecutable": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
        }
    ]

注:runtimeExecutable配置项为chrome安装位置
步骤三:ng serve启动项目
步骤四:以Debugger方式在浏览器运行项目

你可能感兴趣的:(typescript,angular)