javascript - AngularJS: How to make parent directive using transclusion be compiled before the child directive? -
i have following structure:
<dad-dir> <kid-dir></bar-dir> <kid-dir></bar-dir> </dad-dir>
here, daddir
parent directive, , kiddir
child directive. in daddir
, transclude
set true. output looks this:
<div class='dad-dir'> <span class='kid-dir'>kid directive output</span> <span class='kid-dir'>kid directive output</span> </div>
the problem i'm having is, kiddir
s being compiled / linked before daddir
. problem because want daddir
set attributes want kiddir
s inherit. have console.log
line in link
functions of both daddir
, kiddir
, ones in kiddir
logged before daddir
's.
i have tried changing priority, setting daddir
's priority 10 , kiddir
's 1, has no effect.
any ideas?
i believe bug in angularjs version 1.0.5 using. upgraded 1.2 , magically, require: '^daddir
' kiddir
works.
Comments
Post a Comment