Angular Multi Select Drop Down Options

Angular Multi Select Drop Down Options

Today, We want to share with you Angular Multi Select Drop Down Options.
In this post we will show you Angular Multi Select Drop Down Options, hear for Angular Multi Select Drop Down Options we will give you demo and example for implement.
In this post, we will learn about Angular Multi Select Drop Down Options with an example.

We can simple use ng-model Directive to create multi-select dropdown list.This directive takes an list of array of value/label objects and all formats data them as a display drop down list where all one or more multiple options can be selected for user with angularjs.Pure simple AngularJS directive data which creates a select dropdown button with multiple option or single selections data.

READ :  Angularjs scope vs rootScope objects Example

AngularJS Dropdown Multiselect List of Features

  • In angular,Based on Bootstrap’s dropdown supported.
  • In angular,jQuery is not necessary.
  • In angular,Seperated your simple data list and the selection all data. no any modification to the data made.
  • In angular,Built-in search supported.
  • In angular,Complete control on the selected all one or more items model to fit it to your requirements.
  • In angular,Two view options selected: normal list and all checkboxes.
  • In angular,Pre-selected values.
  • In angular,Limit selection count.
  • In angular,Grouping items by property.
  • In angular,Callback events supported.

Multi Select Drop Down List Example

<!DOCTYPE html>
<html lang="en">
<head>
<title>AngularJS Multi Select Drop Down Options | Multi Select Drop Down List Directive For AngularJS - Angular Script</title>
 <script src="https://infinityknow.com/libs/angular.min.js"></script>
 <script>
var infinityknowApp = angular.module("infinityknowApp", []);
 infinityknowApp.controller("ngfreeCtrl", function($scope) {
 $scope.selected = [
        {id:1, name:"Laravel"}
    ];
    
    $scope.totalselecteditem = [];
    
    $scope.$watch('selected', function(valselect){
        $scope.totalselecteditem = [];
        if( ! valselect ){
            return;
        }
        angular.forEach(valselect, function(data){
            $scope.totalselecteditem.push( data.id.toString() );
        });
    });

});
</script> 
</head>
<body>  
<div ng-app="infinityknowApp">  
<div ng-controller="ngfreeCtrl">  
 <label>Select Total Items Display:</label><hr>
    <select multiple ng-model="totalselecteditem">
        <option value="1">Laravel</option>
        <option value="2">Angularjs</option>
        <option value="3">PHP</option>
        <option value="4">VueJs</option>
    </select>
	<p>
    <pre> totalselecteditem = {{totalselecteditem}}</pre>
	</p>
</div>  
</div> 
</body>  
</html>       

Download

READ :  Vuejs AJAX From Submit using Laravel PHP

Add a Comment

Your email address will not be published. Required fields are marked *