Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 797
James Avatar asked Apr 26 '16 09:04

James


People also ask

How do I fix Chrome Developer Tools?

# Open the Issues tabOpen DevTools. Click the Go to Issues button in the yellow warning bar. Alternatively, select Issues from the More tools menu. Once you're on the Issues tab, click the Reload page button if necessary.

How do I run an Angular project in Chrome?

You can find Angular DevTools in the Chrome Web Store and in Firefox Addons. After installing Angular DevTools, find the extension under the Angular tab in your browser DevTools. Lets you explore the components and directives in your application and preview or edit their state.

How do I enable dev tools in Chrome?

From the Chrome menu: Open the Chrome menu and go to “More Tools” > “Developer Tools.” Finally, you can right-click (Windows) or Ctrl-click (Mac) anything on a web page and select “Inspect Element” to open Developer Tools. The Developer Tools panel will open in whatever web page you're on.


Video Answer


1 Answers

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.

like image 121
James Avatar answered Sep 20 '22 13:09

James