Display of Function Watches #3
Comments
You could also try naming your $watch functions, eg: scope.$watch(function watchThat() {
return that();
}, function whenThatChanges(newValue, oldValue) {
}); Batarang will probably give you the function names. |
Since Coffeescript does not allow compiling named functions as suggested by ajoslin, I also would like to see functionality allowing me to click on a function in the performance tab and be taken to the Sources (not Resources) tab to view the line/function in question. Similar to functionality when you click on something like "script.js:10" in the console after doing a console.log. |
Great ideas, guys. I'm looking into all of those things now. I'm not entirely sure how possible it is to get the line number of a function declaration in Chrome. I found this interesting method to get line numbers by throwing exceptions, but that seems a bit hackish and would require extensive instrumentation. |
Update: when using the Batarang, it's best to use the un-minified version of AngularJS, which has more instructive watch function names that Batarang knows how to display. I'm considering including a mapping of the minified name to a useful, debug-able name in another version of Angular, but such a mapping would need to be created for each and every version of AngularJS (which is tedious to maintain). |
Added a note to the FAQ: https://github.com/angular/angularjs-batarang/blob/master/FAQ.md I think in the long term, it would be interesting to incorporate sourcemaps for debugging coffeescript/minified apps. If someone needs/wants such a feature, please file a new issue. Closing this one. |
Hi,
in my project time recorder application (http://www.sekas.de/ptr), I use quite a few watches with function expressions as the first argument.
For anonymous functions, the batarang just displays function() in the performance tab. A file name/line number pair would be great for identifying these functions.
The text was updated successfully, but these errors were encountered: