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

#48 NgParameter.linkToParameter() : modif pour généraliser aux Result et résultats complémentaires

parent bb103d98
No related branches found
No related tags found
1 merge request!22Resolve "Lier des paramètres ou des résultats entre les calculettes"
......@@ -141,7 +141,7 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy {
this._currentIndex = index;
const lp = this._linkableParams[index];
this._param.linkToParameter(lp.nub, lp.value);
this._param.linkToParameter(lp.nub, lp.name);
}
}
......
......@@ -130,15 +130,15 @@ export class NgParameter extends InputField implements Observer {
/**
* crée le lien avec un paramètre
*/
public linkToParameter(n: Nub, p: ParamDefinition) {
const changed: boolean = this._paramDef.valueMode !== ParamValueMode.LINK || this._paramDef.referencedNub !== n || this._paramDef.referenceDefinition !== p.symbol;
public linkToParameter(n: Nub, ref: string) {
const changed: boolean = this._paramDef.valueMode !== ParamValueMode.LINK || this._paramDef.referencedNub !== n || this._paramDef.referenceDefinition !== ref;
if (changed) {
let o = asObservable(this._paramDef.referencedObject);
if (o !== undefined)
o.removeObserver(this);
this.valueMode = ParamValueMode.LINK;
this._paramDef.defineReference(n, p.symbol);
this._paramDef.defineReference(n, ref);
o = asObservable(this._paramDef.referencedObject);
if (o !== undefined)
......@@ -146,7 +146,7 @@ export class NgParameter extends InputField implements Observer {
this.notifyObservers({
"action": "valueLinkChange",
"value": this._paramDef.getValue()
"value": this.getValue()
});
}
}
......
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