112
rated 0 times
[
114]
[
2]
/ answers: 1 / hits: 20819
/ 8 Years ago, thu, december 8, 2016, 12:00:00
In my app I got 7 checkboxes. I want to get the value of the selected checkbox and store into an object. Ff it is deselected I want to remove it in the object.
HTML
<span ng-repeat=days in selectDays>
<input type=checkbox id={{days}} ng-model=daysSelected/>
<label for={{days}}>{{days}}</label>
</span>
Controller
$scope.selectDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
$scope.selectedList = {}; //this is the object to store the selected checkbox values
More From » angularjs