This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngInclude behavior change from 1.2.1 -> 1.2.2 #5247
Milestone
Comments
Thanks for reporting! In 1.2.1 we updated the element's content before executing the transclusion link function. Now we are first executing the transclusion link function and assigning the template afterwards. A possible solution: Define two ng-include directives
By this directives with lower priority would see the filled html. Same applies to |
it would be pretty easy to create those directives with minimal/DRY code, but perhaps it would be good to consider other solutions first |
Discussed with @IgorMinar to fix this with secondary |
tbosch
added a commit
to tbosch/angular.js
that referenced
this issue
Dec 13, 2013
The template needs to be added to the DOM before other directives at the same element as `ngView` are linked. Related to angular#5247.
tbosch
added a commit
to tbosch/angular.js
that referenced
this issue
Dec 13, 2013
The template needs to be added to the DOM before other directives at the same element as `ngInclude` are linked. Fixes angular#5247.
tbosch
added a commit
that referenced
this issue
Dec 13, 2013
The template needs to be added to the DOM before other directives at the same element as `ngView` are linked. Related to #5247.
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
The template needs to be added to the DOM before other directives at the same element as `ngView` are linked. Related to angular#5247.
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
The template needs to be added to the DOM before other directives at the same element as `ngInclude` are linked. Fixes angular#5247.
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
The template needs to be added to the DOM before other directives at the same element as `ngView` are linked. Related to angular#5247.
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
The template needs to be added to the DOM before other directives at the same element as `ngInclude` are linked. Fixes angular#5247.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you have a directive on an ng-include attribute, it appears the content is not loaded prior to executing your directive's link function. In 1.2.0 and 1.2.1, the following code would have children().length == 1. In 1.2.2, the content doesn't get included until after this directive is executed. I tried setting the priority of my directive but it still gets invoked before the template has been loaded.
What is the expected behavior here? Is it defined? Do I just need to add an onload event handler in case the child gets loaded subsequent to my directive's link function being called? (I tried running this in post-link but behavior was the same).
// Full plunkr showing the problem. Just change angular version.
http://plnkr.co/edit/VWA0JTcpNDoNZkTrmllA?p=preview
The text was updated successfully, but these errors were encountered: