I am using one controller on two different part of Page, For that i am using alias of controller using "controller as" syntax. But after upgrading to Angular 1.3.15 it is no longer working.Following is the fiddle to simulate the situation.
Working example with 1.2.20
it is not working with 1.3.15
Please let me know if i am making any mistakes.
<div ng-app="myapp">
<div ng-controller="PersonCtrl">
<input type="text" ng-model="first">
<p>{{first}}</p>
</div>
<div ng-controller="PersonCtrl as person">
<p>{{person.$scope.first}}</p>
</div>
From : docs.angularjs.org
The isolated scope of a component directive no longer leaks into the template that contains the instance of the directive. This means that you can no longer access the isolated scope from attributes on the element where the isolated directive is defined.
See https://github.com/angular/angular.js/issues/10236 for an example.
Requesting isolate scope and any other scope on a single element is an error. Before this change, the compiler let two directives request a child scope and an isolate scope if the compiler applied them in the order of non-isolate scope directive followed by isolate scope directive.
Now the compiler will error regardless of the order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With