Created
September 12, 2016 16:23
-
-
Save unicodeveloper/002e43117a838cea10e43c015710fea2 to your computer and use it in GitHub Desktop.
Cloudinary Blog Post - Part 1
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
app.controller('AuthController', ['$scope','$location','$auth','toastr', function($scope, $location, $auth, toastr) { | |
$scope.login = function() { | |
$auth.login($scope.user) | |
.then(function() { | |
toastr.success('You have successfully signed in!'); | |
$location.path('/'); | |
}) | |
.catch(function(error) { | |
toastr.error(error.data.message, error.status); | |
}); | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment