angular-multi-select

A multi-select directive for AngularJS

3 years after

angular-multi-select

A multiple-select widget for AngularJS.

Mobile friendly: Uses checkboxes rather than <input type="multiple"> for each selection side.

Features:

  • Pass in an expression to represent the display of an item
  • Column headers customizable
  • (6/3/14) Supports a new attribute 'required-min' which adds form validation for a minimum number of selected values.
  • (6/5/14) If a 'title' expression is provided, it is evaluated to show a tooltip for each item
  • (7/2/14) Templates have been extracted so they can be easily overridden, a la angular-ui-bootstrap.

Usage: angular.module('myApp', ['multi-select', ...]);

Example:

<multi-select ng-model="user.roles" available="roles" selected-label="Current roles" 
    available-label="Available roles" display="r as r.roleName"
    title="r as r.roleDescription" config="selectConfig"></multi-select>

where the controller contains

$scope.roles = [
  {roleId: 1, roleName: "Administrator", roleDescription: "Can do a bunch of stuff"},
  {roleId: 2, roleName: "Super User", roleDescription: "Ultimate power!"}
];

$scope.user = {
  roles: [$scope.roles[0]]
};

$scope.selectConfig = {
  requiredMin: 1
};

More information here: http://blog.boxelderweb.com/2013/08/22/angularjs-multi-select-widget/

License: MIT

Updates

  • 8/22/14: Merged tests, fixed bug where async init data was sometimes improperly handled

Related Repositories

angular-dynamic-forms

angular-dynamic-forms

Build Forms in AngularJS From Nothing But JSON (please see Alternatives in the R ...

angular-base64-upload

angular-base64-upload

Converts files from file input into base64 encoded models. ...

angular-validation

angular-validation

Angular Form Validation made simple ...

awesome-angular-components

awesome-angular-components

Catalog of Angular 2+ Components & Libraries ...

ng-select

ng-select

A select component for angular (based on select2). ...


Top Contributors

alalonde stumpdk