简体   繁体   English

AngularJS watch - 无法使用devtools工作区在chrome中设置断点

[英]AngularJS watch - unable to set breakpoint in chrome using devtools workspaces

Does the watch service create a proxy of the original function ? watch服务是否创建了原始函数的代理?

$scope.$watch('query', doSearch, true);

where : 其中:

doSearch = function(query) {
  alert("breakpoint not working");
  // stuff
}

The alert gets shown, but if I add a breakpoint to the code using chrome debugger, its does not break at all. 显示警报,但如果我使用chrome调试器向代码添加断点,它根本不会中断。 Whereas other break points in non-watched javascript functions work as normal. 而非观看的javascript函数中的其他断点正常工作。

Update : The break point works fine when I don't use the workspaces feature of chrome dev tools. 更新:当我不使用chrome dev工具的工作区功能时,断点工作正常。

Try using the debugger command.. 尝试使用debugger命令..
For me it works when regular breakpoints to work on chrome. 对我来说,它适用于常规断点以处理chrome。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM