mirror of https://github.com/akveo/blur-admin
Update switch.directive.js
the switch work failed! you should add listener on input,such as line 28~31.pull/89/head
parent
be74da99b5
commit
85181fd59d
|
@ -20,10 +20,16 @@
|
|||
link: function (scope, elem, attr) {
|
||||
$timeout(function(){
|
||||
scope.color = attr.color;
|
||||
$(elem).find('input').bootstrapSwitch({
|
||||
var input = $(elem).find('input');
|
||||
input.bootstrapSwitch({
|
||||
size: 'small',
|
||||
onColor: attr.color
|
||||
});
|
||||
input.on('switchChange.bootstrapSwitch', function(event, state) {
|
||||
scope.ngModel = state;
|
||||
scope.$apply();
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue