Skip to content

Instantly share code, notes, and snippets.

@thebigredgeek
Created October 7, 2013 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebigredgeek/6868057 to your computer and use it in GitHub Desktop.
Save thebigredgeek/6868057 to your computer and use it in GitHub Desktop.
weird
login: () =>
self = this
@$scope.data.toggle = false #toggle the buttons off
@FB.login(@$scope.data.email, @$scope.data.password).then ((data)-> # Try to login
self.$modalInstance.close # If successful, close the modal
email: self.$scope.data.email # and pass the email address
),(reason)-> # If failure
console.log(reason);
self.$scope.data.error = @FBErrCode.parse(reason.code) # set the error string
self.$scope.data.toggle = true # and toggle the buttons back on
true #Return
Compiles to:
this.FB.login(this.$scope.data.email, this.$scope.data.password).then((function(data) {
return self.$modalInstance.close({
email: self.$scope.data.email
});
}), function(reason) {
console.log(reason);
self.$scope.data.error = this.FBErrCode.parse(reason.code);
return self.$scope.data.toggle = true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment