In my component I have a foreach loop that is fired when a client is selected. Inside this loop I have to call a function in the same component.
To do this I must use this.functionName() to call the function. But obviously this will not work inside the foreach loop since 'this' is no longer the component itself.
Does anyone have a solution for this?
this.clientService.selectedClient.forEach(function(client) {
this.getIntake(); // not working
});