0
我正在通過一些文檔進行優化閱讀,並看到了一個有趣的值,他們將其添加到範圍中。我不確定我完全理解它。優化定義範圍
這裏是他們的文檔功能
function(activate, options) {
var scope = window.angular.element('body').scope();
scope.$on('$locationChangeSuccess', function(event, next, current) {
if (next.indexOf('/productPage') != -1) {
if (!options.isActive) {
activate();
}
}
});
}
我不完全遵循VAR範圍這是類似於* $ rootscope *?
我知道你可以這樣做
angular.element($0).scope()
我看到的窗口,要認爲這是超越局部範圍得到相關範圍的值。