|
6 | 6 | <h1>Sign up</h1> |
7 | 7 | </div> |
8 | 8 | <div class="col-sm-12"> |
9 | | - <form class="form" name="form" ng-submit="register(form)" novalidate> |
| 9 | + <form class="form" name="form" ng-submit="vm.register(form)" novalidate> |
10 | 10 |
|
11 | | - <div class="form-group" ng-class="{ 'has-success': form.name.$valid && submitted, |
12 | | - 'has-error': form.name.$invalid && submitted }"> |
| 11 | + <div class="form-group" ng-class="{ 'has-success': form.name.$valid && vm.submitted, |
| 12 | + 'has-error': form.name.$invalid && vm.submitted }"> |
13 | 13 | <label>Name</label> |
14 | 14 |
|
15 | | - <input type="text" name="name" class="form-control" ng-model="user.name" |
| 15 | + <input type="text" name="name" class="form-control" ng-model="vm.user.name" |
16 | 16 | required/> |
17 | | - <p class="help-block" ng-show="form.name.$error.required && submitted"> |
| 17 | + <p class="help-block" ng-show="form.name.$error.required && vm.submitted"> |
18 | 18 | A name is required |
19 | 19 | </p> |
20 | 20 | </div> |
21 | 21 |
|
22 | | - <div class="form-group" ng-class="{ 'has-success': form.email.$valid && submitted, |
23 | | - 'has-error': form.email.$invalid && submitted }"> |
| 22 | + <div class="form-group" ng-class="{ 'has-success': form.email.$valid && vm.submitted, |
| 23 | + 'has-error': form.email.$invalid && vm.submitted }"> |
24 | 24 | <label>Email</label> |
25 | 25 |
|
26 | | - <input type="email" name="email" class="form-control" ng-model="user.email" |
| 26 | + <input type="email" name="email" class="form-control" ng-model="vm.user.email" |
27 | 27 | required |
28 | 28 | mongoose-error/> |
29 | | - <p class="help-block" ng-show="form.email.$error.email && submitted"> |
| 29 | + <p class="help-block" ng-show="form.email.$error.email && vm.submitted"> |
30 | 30 | Doesn't look like a valid email. |
31 | 31 | </p> |
32 | | - <p class="help-block" ng-show="form.email.$error.required && submitted"> |
| 32 | + <p class="help-block" ng-show="form.email.$error.required && vm.submitted"> |
33 | 33 | What's your email address? |
34 | 34 | </p> |
35 | 35 | <p class="help-block" ng-show="form.email.$error.mongoose"> |
36 | | - {{ errors.email }} |
| 36 | + {{ vm.errors.email }} |
37 | 37 | </p> |
38 | 38 | </div> |
39 | 39 |
|
40 | | - <div class="form-group" ng-class="{ 'has-success': form.password.$valid && submitted, |
41 | | - 'has-error': form.password.$invalid && submitted }"> |
| 40 | + <div class="form-group" ng-class="{ 'has-success': form.password.$valid && vm.submitted, |
| 41 | + 'has-error': form.password.$invalid && vm.submitted }"> |
42 | 42 | <label>Password</label> |
43 | 43 |
|
44 | | - <input type="password" name="password" class="form-control" ng-model="user.password" |
| 44 | + <input type="password" name="password" class="form-control" ng-model="vm.user.password" |
45 | 45 | ng-minlength="3" |
46 | 46 | required |
47 | 47 | mongoose-error/> |
48 | 48 | <p class="help-block" |
49 | | - ng-show="(form.password.$error.minlength || form.password.$error.required) && submitted"> |
| 49 | + ng-show="(form.password.$error.minlength || form.password.$error.required) && vm.submitted"> |
50 | 50 | Password must be at least 3 characters. |
51 | 51 | </p> |
52 | 52 | <p class="help-block" ng-show="form.password.$error.mongoose"> |
53 | | - {{ errors.password }} |
| 53 | + {{ vm.errors.password }} |
54 | 54 | </p> |
55 | 55 | </div> |
56 | 56 |
|
57 | | - <div class="form-group" ng-class="{ 'has-success': form.confirmPassword.$valid && submitted, |
58 | | - 'has-error': form.confirmPassword.$invalid && submitted }"> |
| 57 | + <div class="form-group" ng-class="{ 'has-success': form.confirmPassword.$valid && vm.submitted, |
| 58 | + 'has-error': form.confirmPassword.$invalid && vm.submitted }"> |
59 | 59 | <label>Confirm Password</label> |
60 | | - <input type="password" name="confirmPassword" class="form-control" ng-model="user.confirmPassword" |
61 | | - match="user.password" |
| 60 | + <input type="password" name="confirmPassword" class="form-control" ng-model="vm.user.confirmPassword" |
| 61 | + match="vm.user.password" |
62 | 62 | ng-minlength="3" required/> |
63 | 63 | <p class="help-block" |
64 | | - ng-show="form.confirmPassword.$error.match && submitted"> |
| 64 | + ng-show="form.confirmPassword.$error.match && vm.submitted"> |
65 | 65 | Passwords must match. |
66 | 66 | </p> |
67 | 67 | </div> |
|
0 commit comments