Sha256: ff412f3bc4ca1a624545fdf051e52605bcc18bd8647ded74f87834e3d6ed0b16

Contents?: true

Size: 570 Bytes

Versions: 1

Compression:

Stored size: 570 Bytes

Contents

Sprangular.controller 'AccountCtrl', (
  $scope,
  $location,
  $routeParams,
  Status,
  Account,
  user
) ->
  Status.setPageTitle('nav.my_account')

  user.password = ''
  user.password_confirmation = ''

  $scope.editing = false
  $scope.user = user

  $scope.edit = ->
    $scope.editing = true

  $scope.stopEdit = ->
    $scope.editing = false

  $scope.save = ->
    user.errors = {}

    Account.save(user)
      .then (content) ->
        $scope.editing = false
        $location.path('/') if !Account.isLogged
      , (errors) ->
        user.errors = errors

Version data entries

1 entries across 1 versions & 1 rubygems

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