Skip to content

Instantly share code, notes, and snippets.

@javaeeeee
Created February 6, 2017 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javaeeeee/a406db2cd7ad52f58bd07128fd947a66 to your computer and use it in GitHub Desktop.
Save javaeeeee/a406db2cd7ad52f58bd07128fd947a66 to your computer and use it in GitHub Desktop.
AngularJS nested scopes Controller As syntax
<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