AngularJS - Get reference to $rootscope in child window

前端 未结 1 1805
温柔的废话
温柔的废话 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

    You can get the $rootScope by:

    angular.element('#app-container').scope()
    

    0 讨论(0)
提交回复
热议问题