Angular 7 : Injected service is undefined

The same thing happened to me, the solution was the one mentioned by the user span

-> Passing arrow function instead of regular function in the callback. Arrow functions don’t have its own this.

Difference between regular functions and arrow functions here

Leave a Comment