javascript - Break on variable change in Chrome using Angular -
Similar to the question, I want to break a variable change in Chrome. However, I am using angular, so the variable I want to break is only defined in HTML. Essentially something like this -
& lt; Div ng-click = "show =! Show" & gt; ... & lt; Div & gt; & Lt; Div ng-class = "{expanded: show}" & gt; ... with no code in the controller. So when I change , how can Chrome be stopped? I know that I can convert the code into a function call that wraps up show and then puts a breakpoint there, but its time is inappropriate and I would like to know whether the straightforward break There is no way to do variable changes on.
OK, you can get the desired feature through the console: < Ol>
Get access to the first radius, on which the show property is defined. An explanation of how you can do it. You can then see the changes of this scope object through Chrome's Object.observe . To simplify this process, you can define a global function such as this:
function breakdown (property, object) {object. Object (object, function (change) {changes.forEach} (function (change) {if (change.name === property) {Console.log ("Property" + Property + "changed"); console.log (change ); Debugger;}});}); } and then after the type 1 in the console: breakOn ('show', $ scope);
Comments
Post a Comment