James
James

Reputation: 818

Angular not defined in Chrome Developer Tools

I often use a variation of angular.element($0).scope() as a way of debugging angular issues.

However since moving to a new computer Developer tools always returns Uncaught ReferenceError: angular is not defined

Angular itself is running fine and is not minified (in dev environment) and I've 'inspected' an element which is in the correct scope.

Upvotes: 6

Views: 4567

Answers (2)

James
James

Reputation: 818

I've worked out the issue. In the screenshot below there is a dropdown currently selected as 'top', it was set to JSON Formatter (a plugin I have). So it was trying to run the command in the wrong scope.

Dev Tools

Ignore the top error (failed to load), that's unrelated.

Upvotes: 10

Ambegodas
Ambegodas

Reputation: 133

Please try after clicking on an HTML element which is enclosed with an $scope.

Upvotes: 0

Related Questions