Bez popisu

signup.js 476B

1234567891011121314
  1. angular.module('MyApp')
  2. .controller('SignupCtrl', function($scope, $location, $auth, toastr) {
  3. $scope.signup = function() {
  4. $auth.signup($scope.user)
  5. .then(function(response) {
  6. $auth.setToken(response);
  7. $location.path('/');
  8. toastr.info('You have successfully created a new account and have been signed-in');
  9. })
  10. .catch(function(response) {
  11. toastr.error(response.data.message);
  12. });
  13. };
  14. });