Search code examples
angularlambdaopenlayers

How to pass multiple parameters to lambda function


i would like to know please how can i pass some parameters to the labmda function this.func?

i want to be able to pass three parameters including the event, and display its contents using console.log

code:

this.map.un('pointermove',this.func)

private func = (e)=>{
    console.log(e)
}

Solution

  • this.map.on('pointermove', (event) => this.func(event, param1, param2));
    
    private func = (e, p1, p2) => {
      console.log('Event:', e);
      console.log('Param1:', p1);
      console.log('Param2:', p2);
    };