all files / app/main/components/material-docs/demo-partials/checkbox/demoSyncing/ script.js

10% Statements 1/10
0% Branches 0/2
0% Functions 0/3
10% Lines 1/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                                           
 
angular.module('checkboxDemo2', ['ngMaterial'])
 
.controller('AppCtrl', function($scope) {
 
    $scope.items = [1,2,3,4,5];
      $scope.selected = [];
 
      $scope.toggle = function (item, list) {
        var idx = list.indexOf(item);
        if (idx > -1) {
          list.splice(idx, 1);
        }
        else {
          list.push(item);
        }
      };
 
      $scope.exists = function (item, list) {
        return list.indexOf(item) > -1;
      };
});