Accessing Scope from The Console

Share this video with your friends

Send Tweet

The Chrome Dev Tools console is an amazing tool. In this lesson you'll learn how to use the console to programmatically grab scopes in your AngularJS application.

David
David
~ 11 years ago

You can get $scope in chrome dev tools by installing Angularjs Batarang from the chrome web store. Thats pretty sweet too!

Ramiro
Ramiro
~ 10 years ago

anyone happen to know how to access the "controllers" scope when using controller as syntax? I can access the scope, but not the controller :)

John Lindquist
John Lindquist(instructor)
~ 10 years ago

The "controller as" is simply on the scope, so get the scope, then scope.myController (or whatever you aliased your controller to).

Michael
Michael
~ 10 years ago

I think you can just use $scope w/o creating the var $scope = angular.element($0).scope() and it works the same.