Files
openfoodnetwork/app/assets/javascripts/darkswarm/controllers/signup_sidebar_controller.js.coffee
2014-03-21 15:18:27 +11:00

15 lines
469 B
CoffeeScript

window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope, $http) ->
$scope.spree_user = {}
$scope.errors =
email: null
password: null
$scope.active = ->
$scope.active_sidebar == '/signup'
$scope.submit = ->
$http.post("/user/spree_user", {spree_user: $scope.spree_user}).success (data)->
location.href = location.origin + location.pathname # Strips out hash fragments
.error (data) ->
$scope.errors = data