Sha256: d604911716acca41ad1c42d3277c672649ef83ff6c70cad814a69cfc8d2c65ee

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

Sprangular.controller 'SignupCtrl', (
  $scope,
  $location,
  Account,
  Status,
  Flash,
  $translate
) ->
  Status.setPageTitle('nav.register')

  $scope.user = { email: '', password: '', password_confirmation: '', errors: {} }
  $scope.loading = false

  $scope.submit = ->
    $scope.user.errors = {}
    $scope.loading = true

    Account.signup($scope.user)
      .success (content) ->
        $scope.loading = false
        Flash.success 'app.signed_up_msg'
        $location.path(Status.requestedPath || "/")
        Status.requestedPath = null

      .error (data) ->
        $scope.loading = false
        $scope.user.errors = data.errors

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sprangular-0.1.0 app/assets/javascripts/sprangular/controllers/signup.coffee