Thursday, January 22, 2015

Angular.js: Return a promise that is already resolved

I have an Angular service that either should return an existing object or call a webservice and load some data. To have a consistent client API I want to use a promise in both cases.

It’s not very hard to do this using Angular:

No comments: