Created
October 6, 2013 04:42
-
-
Save thebigredgeek/6849609 to your computer and use it in GitHub Desktop.
Weird error:
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
angular.module("angularQuiz").controller "RegisterModalController", | |
class RegisterModalController | |
prvScope = null #prototype private scope member | |
prvModalInstance = null #prototype private modal instance | |
prvAPIService = null #prototype private api service | |
constructor: ($scope,$modalInstance, APIService) -> | |
prvScope = $scope #set private scope member to injectable | |
prvModalInstance = $modalInstance #set private modal instance member to injeactable | |
prvAPIService = APIService #set prival api service member to injectable | |
prvScope.register = @register #bind tryRegister | |
prvScope.close = @close #bind close | |
prvScope.data = {} #prototype data | |
prvScope #return scope | |
resolve = (email) -> #resolve modal interaction | |
console.log 'closing' | |
prvModalInstance.close | |
email: email | |
true #return | |
reject = (reason) -> #reject modal interaction | |
prvModalInstance.dismiss reason | |
true #return | |
register: () -> | |
fail = prvScope.$on("angularFireAuth:error", (event,parameters)-> | |
fail() | |
) | |
success = prvScope.$on("angularFireAuth:login",(event,parameters) -> | |
success() | |
resolve(prvScope.email) | |
true #return | |
) | |
console.log(prvScope) | |
prvAPIService.register prvScope.data.email, prvScope.data.password #attempt to register | |
true #return | |
close: () -> | |
resolve("user") #reject via user interaction | |
true #return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment