Created
February 6, 2017 19:40
-
-
Save javaeeeee/a406db2cd7ad52f58bd07128fd947a66 to your computer and use it in GitHub Desktop.
AngularJS nested scopes Controller As syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section ng-controller="ParentController as parent"> | |
<h4>Parent Scope</h4> | |
<p>{{parent.onlyParent}}</p> | |
<p>{{parent.myModel}}</p> | |
<article ng-controller="ChildController as child"> | |
<h5>Child Scope</h5> | |
<p>{{child.onlyChild}}</p> | |
<p>{{child.myModel}}</p> | |
<p>{{parent.onlyParent}}</p> | |
<p>{{parent.myModel}}</p> | |
</article> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment