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

Commit 596ad75

Browse files
committed
docs(README): Add documentation for multiCheckbox form field. Closes #32
1 parent 909b334 commit 596ad75

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,52 @@ _Example checkbox field_
154154
}
155155
```
156156

157+
---
158+
#### multiCheckbox form field
159+
>The multiCheckbox field allows to have a set of checkboxes which will be bind to a provided model value.
160+
161+
##### options (array, required)
162+
>`options` is an array of options for the multiCheckbox form field to display. Each option should be an object.
163+
164+
##### labelProp (string, optional)
165+
>`labelProp` is what is used for what is shown to the user. Defaults to `name`
166+
167+
##### valueProp (string, optional)
168+
>`valueProp` is what is used for the value assigned to the model. Defaults to `value`
169+
170+
_Example multiCheckbox field_
171+
```json
172+
{
173+
key: 'roles',
174+
type: 'multiCheckbox',
175+
templateOptions: {
176+
label: 'Roles',
177+
options: [{id: 1, title : "Administrator"}, {id: 2, title : "User"}],
178+
valueProp: 'id',
179+
labelProp: 'title'
180+
}
181+
}
182+
```
183+
184+
_Example multiCheckbox field with async options_
185+
```javascript
186+
{
187+
key: 'roles',
188+
type: 'multiCheckbox',
189+
templateOptions: {
190+
label: 'Roles',
191+
options: [],
192+
valueProp: 'id',
193+
labelProp: 'title'
194+
},
195+
controller: function($scope, DataService) {
196+
DataService.getRoles().then(function(roles){
197+
// roles: [{id: 1, title : "Administrator"}, {id: 2, title : "User"}]
198+
$scope.to.options = roles;
199+
});
200+
}
201+
}
202+
```
157203
---
158204
#### Radio form field
159205
>The radio field allows multiple choice input with a series of linked inputs, with `type='radio'`.

0 commit comments

Comments
 (0)