Giter VIP home page Giter VIP logo

Comments (5)

ajoslin avatar ajoslin commented on May 11, 2024

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.

from batarang.

xzachtli avatar xzachtli commented on May 11, 2024

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.

from batarang.

btford avatar btford commented on May 11, 2024

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.

from batarang.

btford avatar btford commented on May 11, 2024

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).

from batarang.

btford avatar btford commented on May 11, 2024

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.

from batarang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.