Invoke $scope function from the browser console

There is a times when you need (or you just think you need) to invoke $scope function (inside your controller) directly from the browser JavaScript console.

DIY method:

The following is possibly the simplest case possible.
Let assume we have the following HTML & JS (no routes, no ng-view):

A here is the code to run inside your console.

Invoke $scope function from the browser console

Using Chrome Developer Tools

With Chrome Dev Tools, you just select an element using Chrome Dev Tools element selector (the loop or ctrl+shift+c on Win) and than you can access the element from the console with the $0, so now you can replace the document.querySelector('#someID') with $0 and run the following in the console:

Batarang (AngularJS Chrome Extension) – If you have Batarang installed, then you get special AngularJS tab, switch gives you overview of your $scope.

Global variable

You can also, go old fashion way and expose you $scope via global variable, and invoke directly through it.

Please let me know if you know any other technics.