
Scenario
We are using one of our Angular class methods bindMe as a callback. During the callback we will be accessing this .
Approach
Use bind .
this.bindMe = this.bindMe.bind(this);Demo
In this demo we perform a callback to bindMe after two seconds:
