39
39
</ td >
40
40
< td >
41
41
< md-input-container class ="demo-full-width ">
42
- < input mdInput #postalCode maxLength ="5 " placeholder ="Postal Code " value ="94043 ">
42
+ < input mdInput #postalCode maxLength ="5 " placeholder ="Postal Code " value ="94043 "
43
+ pattern ="[0-9]{5} ">
43
44
< md-hint align ="end ">
44
45
< md-icon > mode_edit</ md-icon >
45
- {{postalCode.value.length}} / 5
46
+ < span aria-live =" polite " > {{postalCode.value.length}} / 5</ span >
46
47
</ md-hint >
47
48
</ md-input-container >
48
49
</ td >
@@ -153,7 +154,9 @@ <h4>Input</h4>
153
154
placeholder ="Character count (100 max) "
154
155
maxLength ="100 "
155
156
value ="Hello world. How are you? ">
156
- < md-hint align ="end "> {{characterCountInputHintExample.value.length}} / 100</ md-hint >
157
+ < md-hint align ="end " aria-live ="polite ">
158
+ {{characterCountInputHintExample.value.length}} / 100
159
+ </ md-hint >
157
160
</ md-input-container >
158
161
</ p >
159
162
@@ -164,7 +167,9 @@ <h4>Textarea</h4>
164
167
#characterCountTextareaHintExample
165
168
placeholder ="Character count (100 max) "
166
169
maxLength ="100 "> Hello world. How are you?</ textarea >
167
- < md-hint align ="end "> {{characterCountTextareaHintExample.value.length}} / 100</ md-hint >
170
+ < md-hint align ="end " aria-live ="polite ">
171
+ {{characterCountTextareaHintExample.value.length}} / 100
172
+ </ md-hint >
168
173
</ md-input-container >
169
174
</ p >
170
175
</ md-card-content >
@@ -195,7 +200,7 @@ <h4>Textarea</h4>
195
200
< p >
196
201
< md-input-container style ="width: 100% ">
197
202
< input mdInput #input placeholder ="Character count (100 max) " maxLength ="100 ">
198
- < md-hint align ="end "> {{input.value.length}} / 100</ md-hint >
203
+ < md-hint align ="end " aria-live =" polite " > {{input.value.length}} / 100</ md-hint >
199
204
</ md-input-container >
200
205
</ p >
201
206
< p >
@@ -218,16 +223,19 @@ <h4>Textarea</h4>
218
223
< p >
219
224
< md-input-container hintLabel ="Hint label " style ="width: 100% ">
220
225
< input mdInput #hintLabelWithCharCount placeholder ="Show Hint Label With Character Count ">
221
- < md-hint align ="end "> {{hintLabelWithCharCount.value.length}}</ md-hint >
226
+ < md-hint align ="end " aria-live =" polite " > {{hintLabelWithCharCount.value.length}}</ md-hint >
222
227
</ md-input-container >
223
228
</ p >
224
229
< p >
225
230
< md-input-container style ="margin-bottom: 4em ">
226
231
< textarea mdInput #longHint placeholder ="Enter text to count "> </ textarea >
227
232
< md-hint >
228
- Enter some text to count how many characters are in it. The character count is shown on the right.
233
+ Enter some text to count how many characters are in it. The character count is shown on
234
+ the right.
235
+ </ md-hint >
236
+ < md-hint align ="end " style ="white-space: nowrap " aria-live ="polite ">
237
+ Length: {{longHint.value.length}}
229
238
</ md-hint >
230
- < md-hint align ="end " style ="white-space: nowrap "> Length: {{longHint.value.length}}</ md-hint >
231
239
</ md-input-container >
232
240
</ p >
233
241
< p >
@@ -249,7 +257,8 @@ <h4>Textarea</h4>
249
257
< md-input-container [hideRequiredMarker] ="hideRequiredMarker " style ="width: 300px ">
250
258
< input mdInput
251
259
required
252
- [placeholder] ="hideRequiredMarker ? 'Required Without Marker' : 'Required With Marker' ">
260
+ [placeholder] ="hideRequiredMarker ?
261
+ 'Required Without Marker' : 'Required With Marker' ">
253
262
</ md-input-container >
254
263
</ p >
255
264
< p >
@@ -327,11 +336,13 @@ <h4>Textarea</h4>
327
336
< md-card class ="demo-card demo-basic ">
328
337
< md-toolbar color ="primary "> Forms</ md-toolbar >
329
338
< md-card-content >
330
- < md-input-container > < input mdInput placeholder ="reactive " [formControl] ="formControl "> </ md-input-container >
339
+ < md-input-container > < input mdInput placeholder ="reactive " [formControl] ="formControl ">
340
+ </ md-input-container >
331
341
< md-input-container >
332
342
< input mdInput placeholder ="template " [(ngModel)] ="model " required [disabled] ="ctrlDisabled ">
333
343
</ md-input-container >
334
- < button md-raised-button color ="primary " (click) ="formControl.enabled ? formControl.disable() : formControl.enable() ">
344
+ < button md-raised-button color ="primary "
345
+ (click) ="formControl.enabled ? formControl.disable() : formControl.enable() ">
335
346
DISABLE REACTIVE CTRL
336
347
</ button >
337
348
< button md-raised-button color ="primary " (click) ="ctrlDisabled = !ctrlDisabled ">
0 commit comments