You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
When using the bindToController directive property of Angular 1.3.0-rc.1, the isolate scope properties which are bound using the '@' are set properly upon initialization but not kept up to date with subsequent changes.
I have put together a Plunkr to demonstrate the issue. The two-way binding instance, using '=' in the isolate scope, receives updates as the radio button is changed but the binding with '@' does not: http://plnkr.co/edit/cZcz70UlfPRrHZjDWcto?p=preview
Looking at the Angular source, it seems like the case statement for '@' may be keeping the wrong property up to date when the attribute changes (lines 6943-6953 in nodeLinkFn):
case'@':
attrs.$observe(attrName,function(value){isolateScope[scopeName]=value;});attrs.$$observers[attrName].$$scope=scope;if(attrs[attrName]){// If the attribute has been provided then we trigger an interpolation to ensure// the value is there for use in the link fnisolateBindingContext[scopeName]=$interpolate(attrs[attrName])(scope);}break;
It looks like the observe should be updating isolateBindingContext instead of isolateScope so that it keeps the controller instance property up to date instead of the scope property.
The text was updated successfully, but these errors were encountered:
…r is true
'@'-bindings were previously updating the scope when they ought to have been
updating the controller (requested via `bindToController: true` + controllerAs).
It's a one-line fix + test case.
Closesangular#9052
When using the bindToController directive property of Angular 1.3.0-rc.1, the isolate scope properties which are bound using the '@' are set properly upon initialization but not kept up to date with subsequent changes.
I have put together a Plunkr to demonstrate the issue. The two-way binding instance, using '=' in the isolate scope, receives updates as the radio button is changed but the binding with '@' does not:
http://plnkr.co/edit/cZcz70UlfPRrHZjDWcto?p=preview
Looking at the Angular source, it seems like the case statement for '@' may be keeping the wrong property up to date when the attribute changes (lines 6943-6953 in nodeLinkFn):
It looks like the observe should be updating isolateBindingContext instead of isolateScope so that it keeps the controller instance property up to date instead of the scope property.
The text was updated successfully, but these errors were encountered: