Last active
December 20, 2015 10:08
-
-
Save whisher/6112868 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.factory('RecipeLoader',function(Recipe, $q) { | |
return function() { | |
var delay = $q.defer(); | |
Recipe.query({id: 1}, function(recipe) { | |
delay.resolve(recipe); | |
}, function() { | |
delay.reject('Unable to fetch recipe ' + 1); | |
}); | |
return delay.promise; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment