Skip to content
Advertisement

How to return a resolved promise from an AngularJS Service using $q?

My service is:

JavaScript

I’m calling this in my config file via:

JavaScript

However, it complains that then is not a function. Aren’t I returning the resolved promise?

Advertisement

Answer

From your service method:

JavaScript

And in your controller:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement