require(['jquery', 'px-libs/jquery.quickselect'], function($) {
...
});
To use quickselect plugin, you need to include the next scripts:
<script src="path/to/js/libs/jquery.quickselect.js"></script>
<script src="path/to/js/pixeladmin/directives/angular-quickselect.js"></script>
Then inject the plugin into your angular application:
angular.module('yourApp', ['angular-quickselect']);
Alternatively, you can include quickselect plugin using ocLazyLoad plugin:
$ocLazyLoad.load([
{
name: 'angular-quickselect',
files: [
'path/to/js/libs/jquery.quickselect.js',
'path/to/js/pixeladmin/directives/angular-quickselect.js',
],
},
]);
quickselect
directive
You can use quickselect
directive on select elements.
And when the scope is destroyed the directive will be destroyed.
quickselect's options can be specified as attributes (see the plugin's documentation). All options expect an angular expression instead of a literal string.
<select quickselect ng-model="selectModel"
button-class="'btn btn-default'"
active-button-class="'btn-primary active'"
break-out-values="['Breakfast', 'Lunch', 'Dinner']"
select-default-text="'Other'"
wrapper-class="'btn-group'">
...
</select>