I was wondering :
Just as without using controller as syntax , I'd have to do :
<body ng-controller="ParentCtrl">
<input ng-model="name" /> {{name}}
<div ng-controller="ChildCtrl">
<input ng-model="name" /> {{name}} - {{$parent.name}}
</div>
</body>
And now with the Controller as syntax , I can do :
<body ng-controller="ParentCtrl as parent">
<input ng-model="parent.name" /> {{parent.name}}
<div ng-controller="ChildCtrl as child">
<input ng-model="child.name" /> {{child.name}} - {{parent.name}}
</div>
</body>
Which is great , but what about the controller itself ?
With the first example , I could do :
....controller('Controller', function($scope) {
// do something with $parent.$scope...
But now , after using this :
....controller('Controller', function() { //this.mySomething....
Question :
How would I reference the parent ? ( in the alias way!)
I mean , NG come here to help us by using aliases to scope via parent && child ,
But is there any representation to that "help" in the controller ?
$scopewhen usingcontroller assyntax AFAIK