ngCombo
Combobox Component for AngularJS. Support multiple select.
Demo
Installation
-
With Bower :
bower install --save ngCombo
Or download
ngCombo.js
&ngCombo.css
manually -
include
ngCombo.js
&ngCombo.css
after yourangular.js
file -
adding
ngCombo
as a module dependency to your application
Usage
$scope.pkgNames = [
{text: 'tom', value: 1},
{text: 'jerry', value: 2},
{text: 'dickson', value: 3},
{text: 'bob', value: 4},
{text: 'jade', value: 5}
];
$scope.formatter = function (item) {
return item.text.toUpperCase();
};
$scope.parser = function (item) {
return Math.pow(item.value, 2);
};
// 通常和nc-src配合使用
$scope.transform = function (data) {
return data.data;
}
<div ng-combo
nc-limit="30"
ng-model="values"
nc-data="pkgNames"
nc-parser="parser"
nc-formatter="formatter"
nc-transform="transform"
ng-disabled="aSwitchOfThisCombo"
placeholder="Type in package name."
nc-src="'http://lib.cdc.com/oaui/memberinput/data/allmember.php?callback=JSON_CALLBACK'">
</div>