2014년 12월 31일 수요일

[AngularJS] angularjs debugging html files

I am trying to debug an angular app in web storm. My app has many .js files and also .html files. I am able to put breakpoints for .js files but do not see an option to put breakpoints for .html files. This is impeding my analysis. Please help



Breakpoints in HTML? Not sure if I know what you are trying. If you need a breakpoint in ng-init you can set it to the called methos (or make a window.stopHere() function and call that first). If you want to debug loops, if's, ... you would have to set the breakpoint in the angular framework. Any further explenation would be of help to understand your problem.




Thanks Anton. I am trying to debug my entire application, I want to know the exact flow of the control. I am able to put breakpoints using the IDE and also by the way you mentioned (debugger; - wherever I need). However, if I have to put breakpoint at line no 18 in .html page, how would I do? I need this because after the navigation through my breakpoints in .js files, it is disappearing (i can step into each but i am not interested to navigate thru the other supporting files like angular.js etc). What exactly I am looking for is if my app is able to communicate well across .js and .html files



Sorry, really no idea what you are trying to do. What should happen if you set a breakpoint in a .html file in a line like "<div>"? You would need an open source web browser, debug the rendering engine if you need to debug stuff like that. Does not make any sense to me. If something is disappearing than I would have a look at the DOM (maybe it is not visible, wrong absolute position, ...) and if it is not in the DOM the chance is about 99% that you have to dig into the framework if you application code is working. Maybe you can create a small http://plnkr.co/?



댓글 없음:

댓글 쓰기