How to breakpoint or debug on .ts page in angular

Hello Guys, In this post we will talk about how to debug angular components


Step 1 :-

            I have an angular project which name is “Hello-World”.


Step 2 :-

            Run this “Hello-World” project using  below command :-

            ng serve

 

Step 3 :-

            Open running project in “Chrome” browser. And then do “inspect”,

for “inspect” right click on “chrome” browser and click on “inspect” option.


Step 4 :-

            And now go to “sources” tab. Then go to “page -> webpack:// -> . -> src -> app” and here you can see your project component pages. Choose any your project component page folder.

Here I am selecting my component folder “detail”. This folder contains .html, .css and .ts files. Now I will double click on .ts file to apply debugger.

Step 5 :-

            Now I have to apply breakpoints or debugger on .ts page so click on line number for breakpoints.

I am applying breakpoints on “ngOnInit()” in “detail.component.ts” file.


Step 6 :-

            Now when I hit this “detail” page in “chrome” browser and if my “inspect” is open then my breakpoint or debugger is occurred automatically.


Step 7 :-

            If you want to resume debugger or want to go in next line use two option



Comments

Popular posts from this blog

Call CRUD(GET, POST, PUT, DELETE) API using WebClient in c#

Asp.Net MVC 5 authentication and authorization using claims principal