Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit 321786a

Browse files
committed
Merge pull request #58 from nimbly/0.0.15
0.0.15
2 parents 438c47d + 02a68e9 commit 321786a

18 files changed

+46
-3
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Example data as it would be set in the controller
5757
placeholder: 'johndoe',
5858
required: true,
5959
disabled: false //default: false
60+
description: 'Descriptive text'
6061
},
6162
{
6263
key: 'password',
@@ -185,6 +186,13 @@ When constructing fields use the options below to customize each field object. Y
185186
###### Default
186187
>`undefined`
187188
189+
---
190+
##### description (string)
191+
>`description` is used to add descriptive text to all inputs.
192+
193+
###### Default
194+
>`undefined`
195+
188196
---
189197
##### watch.expression (object)
190198
>`watch` has two properties called `expression` and `listener`. The `watch.expression` is added to the formly directive's scope. If it's a function, it will be wrapped and called with the field as the first argument, followed by the normal arguments for a watcher. The `listener` will also be wrapped and called with the field as the first argument, followed by hte normal arguments for a watch listener.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<div class="checkbox">
22
<label>
33
<input type="checkbox"
4+
aria-describedby="{{id}}_description"
45
ng-required="options.required"
56
ng-disabled="options.disabled"
67
ng-model="value">
78
{{options.label || 'Checkbox'}}
89
{{options.required ? '*' : ''}}
910
</label>
11+
<p id="{{id}}_description" class="help-block" ng-if="options.description">{{options.description}}</p>
1012
</div>

src/directives/bootstrap/formly-field-email.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
class="form-control"
88
id="{{id}}"
99
placeholder="{{options.placeholder}}"
10+
aria-describedby="{{id}}_description"
1011
ng-required="options.required"
1112
ng-disabled="options.disabled"
1213
ng-model="value">
14+
<p id="{{id}}_description" class="help-block" ng-if="options.description">{{options.description}}</p>
1315
</div>

src/directives/bootstrap/formly-field-number.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
class="form-control"
88
id="{{id}}"
99
placeholder="{{options.placeholder}}"
10+
aria-describedby="{{id}}_description"
1011
ng-required="options.required"
1112
ng-disabled="options.disabled"
1213
min="{{options.min}}"
1314
max="{{options.max}}"
1415
ng-minlength="{{options.minlength}}"
1516
ng-maxlength="{{options.maxlength}}"
1617
ng-model="value">
18+
<p id="{{id}}_description" class="help-block" ng-if="options.description">{{options.description}}</p>
1719
</div>

src/directives/bootstrap/formly-field-password.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
<input type="password"
77
class="form-control"
88
id="{{id}}"
9+
aria-describedby="{{id}}_description"
910
ng-required="options.required"
1011
ng-disabled="options.disabled"
1112
ng-model="value">
13+
<p id="{{id}}_description" class="help-block" ng-if="options.description">{{options.description}}</p>
1214
</div>

src/directives/bootstrap/formly-field-radio.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
<input type="radio"
1010
name="{{id}}"
1111
id="{{id + '_'+ $index}}"
12+
aria-describedby="{{id}}_description"
1213
ng-value="option.value"
1314
ng-required="options.required"
1415
ng-model="$parent.value">
1516
{{option.name}}
1617
</label>
18+
<p id="{{id}}_description" class="help-block" ng-if="option.description">{{option.description}}</p>
1719
</div>
1820

1921
</div>

src/directives/bootstrap/formly-field-select.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
</label>
66
<select class="form-control"
77
id="{{id}}"
8+
aria-describedby="{{id}}_description"
89
ng-model="value"
910
ng-required="options.required"
1011
ng-disabled="options.disabled"
1112
ng-init="value = options.options[options.default]"
1213
ng-options="option.name group by option.group for option in options.options">
1314
</select>
15+
<p id="{{id}}_description" class="help-block" ng-if="options.description">{{options.description}}</p>
1416
</div>

src/directives/bootstrap/formly-field-text.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
class="form-control"
88
id="{{id}}"
99
placeholder="{{options.placeholder}}"
10+
aria-describedby="{{id}}_description"
1011
ng-required="options.required"
1112
ng-disabled="options.disabled"
1213
ng-model="value">
14+
<p id="{{id}}_description" class="help-block" ng-if="options.description">{{options.description}}</p>
1315
</div>

src/directives/bootstrap/formly-field-textarea.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
id="{{id}}"
99
rows="{{options.lines}}"
1010
placeholder="{{options.placeholder}}"
11+
aria-describedby="{{id}}_description"
1112
ng-required="options.required"
1213
ng-disabled="options.disabled"
1314
ng-model="value">
1415
</textarea>
16+
<p id="{{id}}_description" class="help-block" ng-if="options.description">{{options.description}}</p>
1517
</div>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<div>
22
<label>
33
<input type="checkbox"
4+
aria-describedby="{{id}}_description"
45
ng-required="options.required"
56
ng-disabled="options.disabled"
67
ng-model="value">
78
{{options.label || 'Checkbox'}}
89
{{options.required ? '*' : ''}}
910
</label>
11+
<p id="{{id}}_description" ng-if="options.description">{{options.description}}</p>
1012
</div>

0 commit comments

Comments
 (0)