I have an AngularJS directive, directiveFoo , created by an attribute:
<div directiveFoo></div>
I want my directiveFoo always instantiate another directive, for example. template:
<div directiveBar="123"></div>
My question is, can this be done without creating all the lost nodes? I would like to add replace to my directive, but then it resets directiveFoo
Ultimately, I want:
<div directiveFoo directiveBar="123"></div>
with two controllers attached.
This is a simplified example. I am trying to prevent:
<div directiveA> <div directiveB> <div directiveC="123"> <div directiveD></div> </div> </div> </div>
in cases when I really don't need all the nested DOM nodes
source share