2

I find myself doing the following many, many times in any given Angular session:

  • select an html element in the "elements" tab of the dev tools
  • run scope = angular.element($0).scope()

Is there an easier way to do this? Some chrome extension that will automatically expose the scope of a selected element or some such?

3
  • You could just google "Angular chrome extension" and find out :) Commented Aug 4, 2016 at 22:47
  • batarang. You (in Chrome) can inspect an element and in the dev tools, check out the exact scope that is attached to the element and traverse it all the way to root just as you would a big json object. It'll show up as a new tab, similarly to "Styles" and "Event Listeners" Commented Aug 4, 2016 at 22:47
  • @Neil Why use google when I can help someone earn some invisible pretend stackoverflow money? Commented Aug 5, 2016 at 2:03

1 Answer 1

4

ng-inspector and Batarang can do this.

Note: These won't work if you have debug info disabled - See here: https://docs.angularjs.org/guide/production

Also, these don't work if your application is in a nested iframe. In that case, you need to open the iframe in a new window directly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.