Skip to content

Instantly share code, notes, and snippets.

@abhiaiyer91
Last active Aug 29, 2015
Embed
What would you like to do?
var app = angular.module('PromisesStillAllSoWastedOnMyself', []);
app.controller('YouCtrl', function(TextFromBuddyService){
//Some code goes here
var BuddyTextPromise = function () {
//Your buddy promised to Text you, so this service returns a promise
TextFromBuddyService.getUpdate()
//promise function method: success() or failure()
.success(function(update){
if (update.girl==='Jeannie') {
getReady();
} else {
study();
}
})
.failure(function(error){
study();
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment