multi-select-angularjs
Advanced tools
Comparing version 1.0.0 to 1.0.1
angular.module('jq-multi-select', []). | ||
directive('multiSelect', [function () { | ||
function refresh(element) { | ||
element.multiSelect('refresh'); | ||
} | ||
function refresh(element) { | ||
element.multiSelect('refresh'); | ||
} | ||
function init(element, options) { | ||
var opt = options || {}; | ||
function init(element, options) { | ||
var opt = options || {}; | ||
element.multiSelect(opt); | ||
} | ||
element.multiSelect(opt); | ||
} | ||
return { | ||
require: '?ngModel', | ||
scope: { | ||
multiSelect: '=', | ||
msOptions: '=' | ||
}, | ||
link: function (scope, element, attrs, ngModel) { | ||
init(element, scope.msOptions); | ||
return { | ||
require: '?ngModel', | ||
scope: { | ||
multiSelect: '=', | ||
msOptions: '=' | ||
}, | ||
link: function (scope, element, attrs, ngModel) { | ||
init(element, scope.msOptions); | ||
scope.$watch(function () { | ||
return (ngModel && ngModel.$modelValue) || scope.multiSelect; | ||
}, function (n) { | ||
refresh(element); | ||
}); | ||
} | ||
}; | ||
scope.$watch(function () { | ||
return (ngModel && ngModel.$modelValue) || scope.multiSelect; | ||
}, function () { | ||
refresh(element); | ||
}); | ||
} | ||
}; | ||
}]); |
{ | ||
"name": "multi-select-angularjs", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "AngularJS directive for the \"multi-select\" jQuery plugin", | ||
@@ -24,3 +24,9 @@ "scripts": { | ||
}, | ||
"homepage": "https://github.com/moshfeu/multi-select-angularjs#readme" | ||
"homepage": "https://github.com/moshfeu/multi-select-angularjs#readme", | ||
"dependencies": { | ||
"angular": "^1.5.11", | ||
"jquery": "^3.3.1", | ||
"jquery.quicksearch": "^2.4.0", | ||
"multiselect": "^0.9.12" | ||
} | ||
} |
@@ -0,4 +1,11 @@ | ||
[![https://nodei.co/npm/multi-select-angularjs.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/multi-select-angularjs.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/multi-select-angularjs) | ||
[![HitCount](https://hits.dwyl.com/moshfeu/multi-select-angularjs.svg)](https://hits.dwyl.com/dwyl/start-here) | ||
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/moshfeu/multi-select-angularjs/issues) | ||
An AngularJS directive for the plugin [multi-select](https://github.com/lou/multi-select) | ||
[Demo](http://htmlpreview.github.io/?https://github.com/moshfeu/multi-select-angularjs/blob/master/demo/index.html) | ||
<a href="https://moshfeu.github.io/multi-select-angularjs/demo/" target="_blank">Demo</a> | ||
@@ -8,3 +15,4 @@ Depenecies | ||
- jQuery 1.8+ | ||
- jquery.multi-select.js | ||
- angularjs | ||
- jquery.multi-select.js | ||
@@ -15,3 +23,17 @@ Optinoal | ||
Installation | ||
============ | ||
```shell | ||
npm install multi-select-angularjs --save | ||
``` | ||
```html | ||
<script src="node_modules/jquery/dist/jquery.min.js"></script> | ||
<script src="node_modules/angular/angular.min.js"></script> | ||
<script src="node_modules/multiselect/js/jquery.multi-select.js"></script> | ||
<script src="node_modules/jquery.quicksearch/dist/jquery.quicksearch.min.js"></script> | ||
<script src="node_modules/dist/angular.multi-select.js"></script> | ||
``` | ||
Usage | ||
@@ -23,3 +45,3 @@ ============ | ||
app.module('your-modoule', ['jq-multi-select']); | ||
``` | ||
``` | ||
**html** | ||
@@ -43,3 +65,3 @@ ```html | ||
}; | ||
``` | ||
``` | ||
**html** | ||
@@ -46,0 +68,0 @@ ```html |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35555
12
70
4
+ Addedangular@^1.5.11
+ Addedjquery@^3.3.1
+ Addedjquery.quicksearch@^2.4.0
+ Addedmultiselect@^0.9.12
+ Addedangular@1.8.3(transitive)
+ Addedjquery@3.7.1(transitive)
+ Addedjquery.quicksearch@2.4.0(transitive)
+ Addedmultiselect@0.9.12(transitive)