Fixed Issue ##1235: ObservableArray does not raise its change event when its `length' property is set.

This commit is contained in:
Rossen Hristov
2015-12-11 13:21:12 +02:00
parent 1327f3a094
commit 1717b33622
2 changed files with 41 additions and 2 deletions

View File

@ -70,8 +70,7 @@ export class ObservableArray<T> extends observable.Observable implements observa
}
set length(value: number) {
if (types.isNumber(value) && this._array && this._array.length !== value) {
this._array = this._array.slice(0, value);
this._notifyLengthChange();
this.splice(value, this._array.length - value);
}
}