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.

angularjs $compile

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.

related github issue


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -