You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
With slow internet connection template may load significant time. And scope may be destroyed before template is loaded (e.g. some section is hidden by user action).
ngInclude doesn't check whether scope is destroyed and compiles the template, that may lead to several problems:
Memory leak: compiled template and scope are never destroyed, destroy event will never fire.
If some directive inside ngInclude template requires parent directive from outside of ngInclude, it will throw a js error because outer directive is already destroyed.
The error occurs with angularjs 1.2.29 and 1.4.8.
Possible fix would be checking whether scope is not destroyed before compiling template or cancelling template load promise when scope is destroyed.
With slow internet connection scope may be destroyed before template is loaded.
Previously in this case ngInclude compiled template that leaded to memory leaks
and errors in some cases.
Closes: #13515Closes: #13543
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
With slow internet connection template may load significant time. And scope may be destroyed before template is loaded (e.g. some section is hidden by user action).
ngInclude doesn't check whether scope is destroyed and compiles the template, that may lead to several problems:
Memory leak: compiled template and scope are never destroyed, destroy event will never fire.
If some directive inside ngInclude template requires parent directive from outside of ngInclude, it will throw a js error because outer directive is already destroyed.
The error occurs with angularjs 1.2.29 and 1.4.8.
Possible fix would be checking whether scope is not destroyed before compiling template or cancelling template load promise when scope is destroyed.
This plunker demonstrates the issue: http://plnkr.co/edit/20PSyn65ggL6FPYsLcJX
Ben Nadel also mentioned this issue in this post: http://www.bennadel.com/blog/2891-nginclude-asynchronous-template-life-cycle-bug-in-angularjs.htm
The text was updated successfully, but these errors were encountered: