javascript - Nested Angular Directive behaving differently with `template` vs. `templateUrl` -
i have 'helper' directive allows me access child dom elements within parent directive. however, i'm running issue when i'm using helper directive in conjunction directive. if use template
in directive, works fine. however, if use templateurl
error saying element helper directive saves scope undefined.
a little hard explain, here's plunkr: http://plnkr.co/edit/nhkbgfro7xe3dsalq5bt?p=preview
note: i've added settimeout fires after 5 seconds, allows templateurl
directive work, since it's available on scope of parent directive.
this expected behavior.
post-linking function executed after child elements linked.
note child elements contain templateurl directives not have been compiled , linked since waiting template load asynchronously , own compilation , linking has been suspended until occurs.
it safe dom transformation in post-linking function on elements not waiting async templates resolved.
Comments
Post a Comment