Sha256: abface0babef907175f11697d7e688c9f36454f68799d7628de9c9f93f507b6d

Contents?: true

Size: 780 Bytes

Versions: 2

Compression:

Stored size: 780 Bytes

Contents

import {Controller} from 'a1atscript';

@Controller('RegistrationsCtrl', ['$scope', '$auth', '$state', '$lrdToast', 'Serializer'])
export default function RegistrationsController( $scope, $auth, $state, $lrdToast, Serializer) {
  $scope.registration = {
    email: '',
    emailConfirmation: '',
    password: '',
    passwordConfirmation: ''
  };

  $scope.registrationSubmit = function() {
    var serializer = new Serializer();

    $auth.submitRegistration(serializer.serialize({user: $scope.registration}))
      .then(function(resp) {
        $state.go('root.inner.registrationsSuccess');
      })
      .catch(function(resp) {
        $lrdToast.errorList(resp.data.errors, "We cannot process your registration because:");
        // handle error response
      });
  };

}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xing-framework-0.0.3 default_configuration/base_app/frontend/src/app/auth/registrations/registrationsControllers.js
xing-framework-0.0.2 default_configuration/base_app/frontend/src/app/auth/registrations/registrationsControllers.js