I tried to inject AccountService in the LoginService but it won\'t ,the accountService is undefined but in the other hand the authServiceProvider is defined .
Contraril
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