[英]Call parent method from child app
I have checkbox on child app controller, so when user click on it, I need to call some method from parent controller: Parent app controller: 我在子应用程序控制器上具有复选框,因此当用户单击它时,我需要从父控制器调用某些方法:父应用程序控制器:
<div ng-controller="ParentCntr as parentCntr">
<child-app></child-app>
</div>
Child app: 子应用:
<div class="child-app" ng-controller="ChildCntr as childCntr">
<div class="checkbox no-indent">
<input type="checkbox"
name="test"
id="test"
ng-change="childCntr.DisableText()"
ng-model="childCntr.testVar"/>
<label for="test">Some Text</label>
</div>
</div>
So, how to do this in easiest way? 那么,如何以最简单的方式做到这一点?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.