Skip to content
Snippets Groups Projects
Commit 81a070b9 authored by francois.grand's avatar francois.grand
Browse files

Props.setProps() : correction d'un bug copiant incorrectement les propriétés membres

parent e36c09ec
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ export class Props implements IObservable {
public hasProperties(props: Props | {}): boolean {
const keys = Object.keys(this._props);
const p = props instanceof Props ? props.props : props;
const p = props instanceof Props ? props._props : props;
// if (keys.length != Object.keys(p).length)
// return false;
......@@ -97,12 +97,15 @@ export class Props implements IObservable {
*/
public setProps(props: {}, sender?: any) {
if (props instanceof Props)
var p = props.props;
var p = props._props;
else
p = props;
const changed = this.compareObjects(this._props, p);
if (changed) {
this._props = p;
this._props = {};
for (const k in p)
this._props[k] = p[k];
this.notifyPropsChange(sender);
}
}
......@@ -123,7 +126,7 @@ export class Props implements IObservable {
for (const k in this._props) {
if (res != "[")
res += ", ";
res += `${k}:${this.props[k]}`;
res += `${k}:${this._props[k]}`;
}
res += "]"
return res;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment