Note: This article is published on 02/15/2021, three and half a year ago.
Note on 11/24/2024: I realize the reading is more than 207 K, that is the second highest reading of my all articles, while the number 1 is CORS (3), Enable CORS In .NET Core Web API, that is 225 K readings. This meant how popular it is for the technique I introduced here, how many people they are to use the angular platform. However, this technique, VS Code Extention: Debuger for Google Chrom, has been deprecated, I will introduce a new alternative later (see this Debug Angular (1-1), In VS Code by Debuggers for Chrome New you will see, this article is still valid or useful). (11/24/2024).
This series of articles will discuss debugging for Angular App.
- Debug Angular (1), In VS Code by Debugger for Chrome --- this article
- Debug Angular (2), In Browser --- DevTools
- Debug Angular (3), in Visual Studio
This article will demonstrate how to install and use VS Code Extention: Debuger for Google Chrom,
Introduction
This article will demonstrate how to debug Angular in VS Code and then give some general discussion on debugging in VS Code.
Angular is a great front-end framework for web apps. Angular is usually edited in Visual Studio Code editor. Their powers combined let you not only develop Angular app code but also debug it through the editor! We will introduce the Angular debugging in VS code in this article with an example.
VS Code is also a great source code editor for various language families, such as PHP, Ruby, Go, C#, Python, C++, PowerShell, TypeScript, React, Vue, and many others, and the debugging method introduced here will work for all other languages.
We use VS Code v1.53 to set up debugging for Angular. The content of this article:
- Introduction
- A - Create an Angular application;
- B - Install Debugger for Chrome (you could install other debuggers you like)
- C - Configure Debug Environment;
- D - Start Debugging;
A - Create an Angular application
We use the Angular CLI to create projects,
- npm install -g @angular/cli // Install the Angular CLI
- ng new my-app // Create a new Angular app
- cd my-app // change to the app directory
- code. // Open VS Code for the current directory
B - Install Debugger for Chrome
In VS Code environment: Left Click Manage (Left Bottom Corner) > Extensions (or Ctrl+Shift+X).












sina hzhPosted Aug 2, 2021, 8:51 AM
Thanks, very good and good luck
ca ThichPosted Jun 2, 2021, 12:29 PM
Thanks. Would it be possible to debug Angular app in VS2019?
Raj KumarPosted Feb 16, 2021, 3:47 PM
Good one and useful for angular developer. Thanks for sharing
Siddharth GajbhiyePosted Feb 16, 2021, 5:44 AM
Very informative article thank you so much for sharing
Hamid KhanPosted Feb 15, 2021, 5:40 PM
Very nice explanation...............