I have a code segment in a controller which define directives within a ng-repeat statement.
<div class="Value" ng-repeat="value in valueList">
<my-directive inner-value="value"></my-directive>
</div>
Here I want to communicate between the directives (e.g. - the button in the 2nd directive to be appeared when click on the button of the 1st directive)
What would be the ideal way of communicating between the same level directives through the controller
答案 0 :(得分:2)
我知道有两种方式:
子组件触发事件。
家长收到他们并决定做什么
基于服务
事件的缺点
服务优势