I have a typescript class in my angular project like this:
export class CreateGeojsonLayerCommand implements Icommand {
parameters: Object;
execute(parameters: Object): Object {
this.parameters = parameters;
let layer = new Vector({
style: createStyleFunction
});
}
private createStyleFunction(feature: any): Style {
//this.parameters is undefined here
}
}
The new Vector
object is a third party tool object. So I have create the createStyleFunction
out of the execute
method. But I can not access parameters
variable using this keyword like this.parameters
.