Skip to content

Instantly share code, notes, and snippets.

@DevinClark
Forked from iladarsda/batarang.js
Created June 13, 2014 20:43
Show Gist options
  • Save DevinClark/bb5a1ae17e8f500a52c1 to your computer and use it in GitHub Desktop.
Save DevinClark/bb5a1ae17e8f500a52c1 to your computer and use it in GitHub Desktop.
angular.element($0).scope().someFunction();
// #someID could be any other element within same controller, i.e. same scope
angular.element(document.querySelector('#someID')).scope().someFunction();
<div id="someID" ng-controller="MainCtrl">
// some stuff here
</div>
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