I'm trying to debug my angular2 app with source map by placing a breakpoint in the .ts file.
foo(){
//breakpoint here
console.log('bar');
}
the breakpoint only gets hit when loading that component and not when executing. any idea?
I'm trying to debug my angular2 app with source map by placing a breakpoint in the .ts file.
foo(){
//breakpoint here
console.log('bar');
}
the breakpoint only gets hit when loading that component and not when executing. any idea?
put debugger;
in the line where ever you want.browser will definitely pauses;
Not sure if you still need an answer, but assuming you're doing something like this, I believe angular runs some code only once (like constructors / initialization ... etc).
If the break point is only getting hit once, it is probably because angular intends for that. Try putting your breakpoint in a method that you know for sure gets called multiple times. Try to figure out [where your code is](https://angular.io/docs/ts/latest/guide/architecture.html#!#components in the bigger picture of the architecture of an angular app.
Otherwise, would need more context/info to properly answer.