Last active
August 29, 2015 14:02
-
-
Save iladarsda/6b109491b70bce9e4ebc to your computer and use it in GitHub Desktop.
Invoke $scope function from the browser console
This file contains hidden or 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
angular.element($0).scope().someFunction(); |
This file contains hidden or 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
// #someID could be any other element within same controller, i.e. same scope | |
angular.element(document.querySelector('#someID')).scope().someFunction(); |
This file contains hidden or 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
<div id="someID" ng-controller="MainCtrl"> | |
// some stuff here | |
</div> |
This file contains hidden or 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
function MainCtrl($scope) { | |
$scope.someFunction = function() { | |
console.log("someFunction.."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment