|
95 | 95 | placeholder="123 Topcoder Ave.",
|
96 | 96 | value="{{vm.homeAddress.streetAddr1}}",
|
97 | 97 | ng-model="vm.homeAddress.streetAddr1",
|
98 |
| - ng-class="{'form-field-focused': hasFocus==true}" |
| 98 | + ng-class="{'form-field-focused': hasFocus==true}", |
| 99 | + ng-required="vm.addressDirty = vm.accountInfoForm.address.$dirty || vm.accountInfoForm.city.$dirty || vm.accountInfoForm.state.$dirty || vm.accountInfoForm.zipcode.$dirty || vm.accountInfoForm.country.$dirty" |
99 | 100 | )
|
100 | 101 |
|
| 102 | + .account-info-error(ng-show="vm.addressDirty && vm.accountInfoForm.address.$invalid") |
| 103 | + p(ng-show="vm.accountInfoForm.address.$error.required") Please enter an address |
| 104 | + |
101 | 105 | .form-label Address 2
|
102 | 106 | span(style="text-transform: none;") (opt., suite, etc.)
|
103 | 107 | input.form-field(
|
|
115 | 119 | value="{{vm.homeAddress.city}}",
|
116 | 120 | placeholder="Best City in the World",
|
117 | 121 | ng-model="vm.homeAddress.city",
|
118 |
| - ng-class="{'form-field-focused': hasFocus==true}" |
| 122 | + ng-class="{'form-field-focused': hasFocus==true}", |
| 123 | + ng-required="vm.addressDirty" |
119 | 124 | )
|
120 | 125 |
|
| 126 | + .account-info-error(ng-show="vm.addressDirty && vm.accountInfoForm.city.$invalid") |
| 127 | + p(ng-show="vm.accountInfoForm.city.$error.required") Please enter a city |
| 128 | + |
121 | 129 | .form-label State/Province
|
122 | 130 | input.form-field(
|
123 | 131 | name="state", type="text",
|
124 | 132 | value="{{vm.homeAddress.stateCode}}",
|
125 | 133 | placeholder="California",
|
126 | 134 | ng-model="vm.homeAddress.stateCode",
|
127 |
| - ng-class="{'form-field-focused': hasFocus==true}" |
| 135 | + ng-class="{'form-field-focused': hasFocus==true}", |
| 136 | + ng-required="vm.addressDirty" |
128 | 137 | )
|
129 | 138 |
|
| 139 | + .account-info-error(ng-show="vm.addressDirty && vm.accountInfoForm.state.$invalid") |
| 140 | + p(ng-show="vm.accountInfoForm.state.$error.required") Please enter a state or province |
| 141 | + |
130 | 142 | .form-label Zip
|
131 | 143 | input.form-field(
|
132 | 144 | name="zipcode", type="text",
|
133 | 145 | placeholder="Zip"
|
134 | 146 | value="{{vm.homeAddress.zip}}",
|
135 | 147 | ng-model="vm.homeAddress.zip",
|
136 |
| - ng-class="{'form-field-focused': hasFocus==true}" |
| 148 | + ng-class="{'form-field-focused': hasFocus==true}", |
| 149 | + ng-required="vm.addressDirty" |
137 | 150 | )
|
138 | 151 |
|
| 152 | + .account-info-error(ng-show="vm.addressDirty && vm.accountInfoForm.zipcode.$invalid") |
| 153 | + p(ng-show="vm.accountInfoForm.zipcode.$error.required") Please enter a zip |
| 154 | + |
139 | 155 | .form-label Country
|
140 | 156 | angucomplete-alt(
|
141 | 157 | input-name="country",
|
|
148 | 164 | title-field="name",
|
149 | 165 | match-class="angucomplete-highlight",
|
150 | 166 | minlength="1",
|
151 |
| - ng-class="{'form-field-focused': hasFocus==true}" |
| 167 | + ng-class="{'form-field-focused': hasFocus==true}", |
| 168 | + field-required="vm.addressDirty" |
152 | 169 | )
|
153 |
| - .account-info-error(ng-show="vm.accountInfoForm.country.$invalid") |
| 170 | + .account-info-error(ng-show="vm.addressDirty && vm.accountInfoForm.country.$error.required") |
154 | 171 | p(ng-show="vm.accountInfoForm.country.$error.required") Please choose a country from the list.
|
155 | 172 |
|
156 | 173 |
|
|
0 commit comments