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 $ parent siblings [easily] reach within each other's sphere In your example, you can use child-dair their parents , but parents second parents -Dire

You have returned the object while defining your instructions You can create a new opportunity by using the following:

  scope: {}  

Note: if you scope: true , You can create a separate scope, in which the original probability of rootScope is not its logical parent.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

c# - NewtonSoft JArray - how to select multiple elements with LINQ -

javascript - amcharts makechart not working -