require(['jquery', 'px/extensions/jquery.knob'], function($) {
...
});
To use knob plugin, you need to include the next scripts:
<script src="path/to/js/libs/jquery.knob.js"></script>
<script src="path/to/js/pixeladmin/directives/angular-knob.js"></script>
Then inject the plugin into your angular application:
angular.module('yourApp', ['angular-knob']);
Alternatively, you can include knob plugin using ocLazyLoad plugin:
$ocLazyLoad.load([
{
name: 'angular-knob',
files: [
'path/to/js/libs/jquery.knob.js',
'path/to/js/pixeladmin/directives/angular-knob.js',
],
},
]);
knob
directive
You can use knob
directive on input elements.
And when the scope is destroyed the directive will be destroyed.
knob's options can be specified as data-*
attributes
(see the
plugin's documentation).
Hooks can be bound using attributes (see the plugin's documentation):
<input knob ng-model="knobModel" type="text"
on-cancel="ctrl.cancel"
on-change="ctrl.change">
function SomeController() {
this.cancel = function() { ... };
this.change = function(v) { ... };
});