Last active
February 25, 2018 07:51
-
-
Save atiq1589/9042b92f595cba695357ae32252f09e7 to your computer and use it in GitHub Desktop.
Getting angularjs controller and scope from outside angularjs
This file contains 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
var controller = angular.element("[ng-controller='ControllerName']"); | |
var scope = controller.scope(); |
This file contains 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
var app = angular.element('*[ng-app]'); | |
var service = app.injector().get('ServiceName'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment