11

Now I'm using Webstorm to code and debug Angular but I don't like this IDE. Is there any way to debug angular with VS 2017 ?

ndthanhdev
  • 169
  • 1
  • 2
  • 12

1 Answers1

4

You can debug Angular inside VS2017. Except there are issues not yet resolved. One is that currently you need to set your breakpoints after you start debugging. (I have VS Pro v15.4.1) To see an example of debugging do the following:

  1. Create a project as a Asp.Net Core Web Application and select the "Angular" project template.

  2. Click the down-arrow next to "IIS Express" and set the Web Browser to Google Chrome.

  3. Start debugging. Chrome will display a message about script debugging being enabled. Eventually your app will displace this message.

  4. Set a breakpoint on "this.currentCount++;" in counter.component.ts.

  5. Navigate to the Counter screen and click "Increment". Your breakpoint will be hit.

Make sure that you do not also have the Chrome Developer tools running at the same time (F12 tools).

John Pankowicz
  • 4,203
  • 2
  • 29
  • 47
  • I just tried it again with my current version of VS 15.5.7. It still works for me. When I click the dropdown next to IIExpress, it now has the option "Enable Browser Link", which I set. The browser was already set to Chrome. I set the breakpoint and it hit it when I incremented the counter. – John Pankowicz Mar 01 '18 at 21:09
  • 1
    Browser link was disabled. Enabling it is still the same. I am trying to debug an aspnet core app with angular . Can it cause this ? – FindOutIslamNow Mar 04 '18 at 10:50