|
1 年之前 | |
---|---|---|
.. | ||
.bower.json | 1 年之前 | |
bower.json | 1 年之前 | |
checklist-model.js | 1 年之前 | |
readme.md | 1 年之前 |
AngularJS directive for list of checkboxes
In Angular one checkbox <input type="checkbox" ng-model="...">
is linked
with one model.
But in practice we usually want one model to store array of checked values
from several checkboxes.
Checklist-model solves that task without additional code in controller.
You should play with attributes of <input>
tag:
checklist-model
instead of ng-model
checklist-value
- what should be picked as array itemPlease, try out live demo: http://vitalets.github.io/checklist-model
Jsfiddle: http://jsfiddle.net/Ebv3p/2/
Plunker (more advanced): http://plnkr.co/edit/pZLF0KesMDnIap0eCfSG?p=preview
Download latest release or use bower:
bower install checklist-model
Add to app dependencies:
var app = angular.module("app", ["checklist-model"]);
MIT