Get all checked Checkbox Values in AngularJS

Get all checked Checkbox Values in AngularJS

In this Post We Will Explain About is Get all checked Checkbox Values in AngularJS With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to arrays – How to get checkbox value in angularjs Example

In this post we will show you Best way to implement angularjs – How to get the selected check box value, hear for how to get ng repeat checkbox values on submit function in angularjs with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Include External Libs

  

index.html


AngularJS Checkboxes Bound to Target Array with Initial Selections Checked

{{title}}

Angularjs Checkboxes Example

Live24u is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development.

  • You are Most welcome in my youtube Channel :: SOLVED
  • We deliver the useful and best tutorials for web professionals — developers, programmers, freelancers and site owners. :: SOLVED

{{student.id}} Click this to all the student get_stud this student data with the target array. {{student}} Selected: {{bool}}

angular Final Data Array

{{data | json}}

All Checkboxes Array in angular

{{liveDataList | json}}

index.js

var lb = "• "; // used for console.log()
var liveApp = angular.module("liveApp", []);

liveApp.controller('liveCtrl', function($scope) {
  $scope.title = 'AngularJS Checkboxes Bound to Target Array with Initial Selections Checked';
  $scope.content = '';

  $scope.isChecked = function(id){
      var same = false;
      for(var i=0 ; i < $scope.data.length; i++) {
        if($scope.data[i].id == id){
          same = true;
        }
      }
      return same;
  };
  
  $scope.liveDataList = [
    {
      "id": "1",
      "data": "jaydeep Gondaliya",
    },
    {
      "id": "2",
      "data": "Ankit kathiriya",
    },
    {
      "id": "3",
      "data": "krunal sisodiya",
    },
  ];
    
  $scope.data = [
    {
      "id": "1",
      "data": "jaydeep Gondaliya",
    },
    {
      "id": "3",
      "data": "krunal sisodiya",
    },
  ];

  $scope.get_stud = function(bool, student){
    if(bool){
      // add student
      $scope.data.push(student);
    } else {
      // remove student
      for(var i=0 ; i < $scope.data.length; i++) {
        if($scope.data[i].id == student.id){
          $scope.data.splice(i,1);
        }
      }      
    }
  };
  
});

style.css

.panel {
  width:95%;
  margin:2em auto;
}

get all checked checkbox value in angularjs

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details......
Angularjs Example

Example

I hope you have Got What is Get all checked Checkbox Values in AngularJS And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Leave a Comment