angularjs - How do I share data between child directives in angular? -
Let's say I have two instructions- parent and child- dir
& Lt; Div parent-directory & gt; & Lt; Div hairdryer & gt; & Lt; Div hairdryer & gt; & Lt; / Div & gt; & Lt; Div parent-dir> & Lt; Div hairdryer & gt; & Lt; Div hairdryer & gt; & Lt; / Div & gt; How can I share data between parent instruction and all child-directed instructions within that basic element, but different from other parents?
It depends on how you are establishing your instructions. In a way, a new opportunity has to be created for parents and children's instructions. Parents 'area is automatically inherited in the children's area, and especially the parents' scope can be accessed by You have returned the object while defining your instructions You can create a new opportunity by using the following: Note: if you $ parent siblings [easily] reach within each other's sphere In your example, you can use child-dair their parents , but parents second parents -Dire
scope: {} scope: true , You can create a separate scope, in which the original probability of rootScope is not its logical parent.
Comments
Post a Comment