Here is a quick debugging tip when you want to debug the scope for a specific element:
- Open up your Angular.js application in Chrome
- Use the selection tool(magnifying glass) to select the element you want to inspect
- When the element is selected Chrome will store this element inside a ‘$0’ property
- Now that we have an element reference, we can open up the console and write some code to get to the scope:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var element=angular.element($0); | |
var scope= element.scope(); |