Home > Development Tools > VSCode > body text

Detailed explanation of how to debug Angular programs with VSCode

青灯夜游
Release: 2021-06-18 18:15:01
forward
3457 people have browsed it

This article will introduce to you the debugging Angular program in vscode. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Detailed explanation of how to debug Angular programs with VSCode

Preparation Tools

Install the Debugger for Chrome plug-in in VS Code.

Debugger for Chrome

Recommended learning: "vscode tutorial", "angular tutorial"

Configure lanch .json

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "sourceMaps": true,
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:8080",
      "webRoot": "${workspaceRoot}"
    }
  ]
}
Copy after login

After the configuration is completed, enter the command ng serve in the Angular project directory to start the project, and then you can breakpoint debugging.

Debugging

Press F5 in VS Code to enter debugging mode, open Chrome, refresh the page, and enter the breakpoint.

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of Detailed explanation of how to debug Angular programs with VSCode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!