When trying to set the context of a function and pass it as a callback, I am following this approach:
myController.myService.validateToken(param)
.then( myController.myService.getToken.bind( myController.myService ) );
myController.myService.getToken.bind( myController.myService )
However, I am unsure if this is the correct method?
Is there a similar functionality in Angular like bind()
?