AngularJS - Get reference to $rootscope in child window

前端 未结 1 1762
温柔的废话
温柔的废话 2021-02-19 22:19

I need to kick off an angular event in a child browser window from a parent. My first thought was if I had the module name I should be able to get a reference to the $root

相关标签:
1条回答
  • 2021-02-19 22:54

    If you have an id on your ng-app

    <div id="app-container" ng-app="myApp">
    

    You can get the $rootScope by:

    angular.element('#app-container').scope()
    
    0 讨论(0)
提交回复
热议问题