1

I have an angular2 project generated by angular-cli. I want to be able to debug the angular2 typescript source code in chrome dev tools (not my own typescript code but the actual angular2 code). The angular2 npm package under node_modules only contains the transpiled javascript files but they contain source mappings. How can I make this work? Thx.

sk20b21
  • 51
  • 3

3 Answers3

0

How about putting debugger; at the location you want to debug, this will trigger a breakpoint in chrome dev tools and you can work your way from there.

Mostafa Abdelraouf
  • 628
  • 1
  • 6
  • 14
  • You mean in the angular 2 typescript source code? Ideally, I don't want want edit the angular 2 source code myself just to get debugging. I think there should be some way in the debugger to add the typescript sources but cant get it to work. – sk20b21 Nov 05 '16 at 13:35
0

Open chrome developer tool (F12).

Go to Source tab. Enter ctrl+p.

Search the file name in the drop-down.

Select the file and add break point at the line which you want to debug.

And proceed your actions which calls the line which you want to debug.

Anand Kumar
  • 128
  • 1
  • 5
0

Apparently, this is not yet possible in angular-cli since they ignore source maps in node_modules (https://github.com/angular/angular-cli/issues/1838).

sk20b21
  • 51
  • 3