I've built a simple Angular 2 App - for learning purposes and deploy it to Heroku, set PRODUCTION = TRUE in environment.ts but it seems like i can't add breakpoints in the chrome debugger, the web pack folder isn't shown in the Sources panel - in the developer tools....perhaps there is a way to expose the .ts files and stay in production mode?
-
Why not debug using dev mode instead? which is why it does exists; to help debuggingFindOutIslamNow– FindOutIslamNow2018-05-02 10:29:02 +00:00Commented May 2, 2018 at 10:29
-
Thanks - that's because it's going to be an inner organization app - and the client wants to be able to debug from users computers - and not from the serverRoyBarOn– RoyBarOn2018-05-02 10:33:30 +00:00Commented May 2, 2018 at 10:33
-
Then make it dev modeFindOutIslamNow– FindOutIslamNow2018-05-02 10:34:23 +00:00Commented May 2, 2018 at 10:34
-
@FindOutIslamNow thanks - that's one way for sure - but perhaps there is a better way?RoyBarOn– RoyBarOn2018-05-02 10:35:41 +00:00Commented May 2, 2018 at 10:35
-
1stackoverflow.com/questions/45800032/…FindOutIslamNow– FindOutIslamNow2018-05-02 10:36:22 +00:00Commented May 2, 2018 at 10:36
|
Show 1 more comment
1 Answer
use debugger keyword wherever you need to debug.
getData() {
debugger
// your code to get data
}
open up the browser developer tool then you'll see the magic
for step-in, use F-10 key (in windows)
for continue, use F-8 key (in windows)
for more, visit: Seven Methods for Debugging Angular Applications
3 Comments
RoyBarOn
Thanks - that's very helpful!
WasiF
@RoyBarOn Please don't forget to mark as answer if it helped you
Estus Flask
How can it help in this situation, i can't add breakpoints in the chrome debugger, the web pack folder isn't shown in the Sources panel? A breakpoint is set up on gibberish source code.