Merge pull request #1221 from NativeScript/nnikolov/TwoWayBindingUpdateIssue

Fixed issue with two way binding update.
This commit is contained in:
Nedyalko Nikolov
2015-12-08 17:23:07 +02:00

View File

@ -121,16 +121,17 @@ export class Observable implements definition.Observable {
return this[name]; return this[name];
} }
private disableNotifications = false; //private disableNotifications = false;
private disableNotifications = {};
public _setCore(data: definition.PropertyChangeData) { public _setCore(data: definition.PropertyChangeData) {
this.disableNotifications = true; this.disableNotifications[data.propertyName] = true;
this[data.propertyName] = data.value; this[data.propertyName] = data.value;
this.disableNotifications = false; delete this.disableNotifications[data.propertyName];
} }
public notify<T extends definition.EventData>(data: T) { public notify<T extends definition.EventData>(data: T) {
if (this.disableNotifications) { if (this.disableNotifications[(<any>data).propertyName]) {
return; return;
} }