This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
angular.element.scope() returns undefined #9515
Closed
Description
angular.element.scope() is undefined when the application is loaded in iframe by changing the iframe src attribute.
The following code should return reference to scope but returns undefined:
angular.element(document.body).scope()
The code above is executed in the onclick handler after the document is loaded and angular has finished bootstrap:
<script>
document.addEventListener("click", function(){
console.log(angular.element(document.body).scope());
});
</script>
The issue manifests itself only when the document is loaded in the iframe by modifying its src attribute.
Tested with 1.3.0-rc.5, without jquery.