Created
October 7, 2013 17:39
-
-
Save thebigredgeek/6871855 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
FBase.prototype.register = function(email, password) { | |
var killFailureListener, killSuccessListener, promise, self; | |
this.regDeferral = _q.defer(); | |
self = this; | |
promise = this.regDeferral.promise; | |
killSuccessListener = null; | |
killFailureListener = null; | |
killSuccessListener = _rootScope.$once("angularFireAuth:login", function(event, user) { | |
killFailureListener(); | |
console.log("hello"); | |
self.regDeferral.resolve(user); | |
return true; | |
}); | |
killFailureListener = _rootScope.$once("angularFireAuth:error", function(event, err) { | |
killSuccessListener(); | |
self.regDeferral.reject(err); | |
return true; | |
}); | |
_auth.createUser(email, password); | |
return promise.then(function() { | |
return console.log("world!"); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment