This repository has been 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
replace:true on a directive changes order of directive linking #1567
Labels
Comments
I'm running into this as well |
Wrapping the ng-transclude element in a div apparently fixes the issue: http://jsfiddle.net/VhF7j/9/ template: '<div><p ng-transclude></p></div>' It seems that if the transclude root is the same as the template root then that directive is added at the end of the linking chain |
I came across a related issue while experimenting with different directive params. {
priority : 0 // fails if set higher
replace : true,
transclude : true,
template : "<div ng-transclude></div>"
} |
Holy crap thank you for opening this issue! I've been banging my head against this for over an hour just to learn that |
This is fixed in 1.2.5 (possibly earlier), see http://jsfiddle.net/VhF7j/10/ |
@petebacondarwin can be closed, see fiddle above |
@Narretz - nice one. Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
See also this fiddle: http://jsfiddle.net/VhF7j/6/
When a directive has 'replace:true', all its child directives are linked (post!) before its pre-link is evaluated. This makes it impossible to rely on passing information between directives through element.data and element.inheritedData.
The text was updated successfully, but these errors were encountered: