I am reading through some of the docs for optimizely and saw an interesting value that they add to scope. I am not sure that I fully understand it.
Here is the function in their docs
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();
}
}
});
}
I do not completely follow var scope Is this similar to a * $rootscope * ?
I know you can get the value of an associated scope by doing this
angular.element($0).scope()
I see window and want to assume this is beyond a local scope.