Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在父级的子浏览器窗口中启动一个角度事件。我的第一个想法是,如果我有模块名称,我应该能够$rootScope从角度全局对象中获得对 的引用,但我无法让它工作。
$rootScope
有谁知道$rootScope从角度上下文之外引用对象的最佳方法?
提前致谢。
如果你有你的身份证ng-app
ng-app
<div id="app-container" ng-app="myApp">
您可以通过以下方式获得$rootScope:
angular.element('#app-container').scope()