I have created array list and listing it as multiple check box. From that if i select i'm storing into the array variable and if I uncheck its need to be remove from array. I tried this is working for but while uncheck value is not removing from the array variable.
Here is my code below and jsfiddle
HTML
<div ng-app="myApp" ng-controller="MyCtrl"> <lable ng-repeat="list in lists"> <input type="checkbox" name="chk[]" ng-model="lst" value="{{list.vl}}" ng-change="change()"> {{list.vl}} <br> </lable> </div>
SCRIPT
var myApp = angular.module('myApp', []); myApp.controller('MyCtrl', function($scope){ $scope.lists = [ {'vl' : 1}, {'vl' : 2}, {'vl' : 3}, {'vl' : 4}, {'vl' : 5}, ]; $scope.lst = []; $scope.change = function(){ $scope.lst.push('2'); console.log($scope.lst); }; });