How to use Promise instead of $q with AngularJS

Imagine the following AngularJS application: View the code on Gist. The idea behind the “doWork” function of the service is to execute some asynchronous code and return a promise to be able to perform some actions once this code has been completed. For the sake of this example, we just wait for 2 seconds and […]