Adding basic validation to reg process

This commit is contained in:
Rob H
2014-08-24 11:20:00 +10:00
parent 800eecea33
commit 412e906ed3
3 changed files with 27 additions and 6 deletions

View File

@@ -1,9 +1,7 @@
Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, EnterpriseRegistrationService, availableCountries) ->
$scope.currentStep = RegistrationService.currentStep
$scope.select = RegistrationService.select
$scope.enterprise = EnterpriseRegistrationService.enterprise
$scope.create = EnterpriseRegistrationService.create
$scope.update = EnterpriseRegistrationService.update
$scope.select = RegistrationService.select
$scope.steps = ['details','address','contact','about','images','social']

View File

@@ -0,0 +1,20 @@
Darkswarm.controller "RegistrationFormCtrl", ($scope, RegistrationService, EnterpriseRegistrationService) ->
$scope.submitted = false
$scope.create = (form) ->
$scope.submitted = true
if form.$valid
EnterpriseRegistrationService.create()
$scope.submitted = false
$scope.update = (nextStep, form) ->
$scope.submitted = true
if form.$valid
EnterpriseRegistrationService.update(nextStep)
$scope.submitted = false
$scope.select = (nextStep, form) ->
$scope.submitted = true
if form.$valid
RegistrationService.select(nextStep)
$scope.submitted = false