$scope.Hobbies = []; $scope.Hobbies.push('Cricket'); $scope.Hobbies.push('Reading'); $scope.Hobbies.push('Writing'); $scope.Hobbies.push('Sleeping'); $scope.Hobbies.push('Running'); $scope.Hobbies.push('Football'); $scope.Hobbies.push('Programming'); $scope.selected = {}; $scope.GetSelected = function () { console.log('selected arry....'); $.each($scope.selected, function (value,checked) { console.log(value + '-' + checked); }); }; $scope.SetSelected = function () { //??? };
<div>Hobbies <label ng-repeat="hobbie in Hobbies"> <input type="checkbox" checklist-model="Hobbies" ng-model="selected[hobbie]" checklist-value="{{hobbie}}">{{hobbie}} </label> </div> <a href="javascript:;" data-ng-click="SetSelected();">Set Selected</a>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)