Blame view
app/scripts/app.js
1.46 KB
e4e496d13
|
1 2 3 4 5 6 7 |
/** * INSPINIA - Responsive Admin Theme * */ (function () { angular.module('inspinia', [ 'ui.router', // Routing |
5c6477d3d
|
8 9 |
'ui.bootstrap', // Bootstrap 'ngFileUpload' // File Upload |
e4e496d13
|
10 |
]) |
0a4eb77cc
|
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
.directive('icheck', ['$timeout', '$parse', function($timeout, $parse) { return { restrict: 'A', require: '?ngModel', link: function(scope, element, attr, ngModel) { $timeout(function() { var value = attr.value; function update(checked) { if(attr.type==='radio') { ngModel.$setViewValue(value); } else { ngModel.$setViewValue(checked); } } $(element).iCheck({ checkboxClass: attr.checkboxClass || 'icheckbox_square-green', radioClass: attr.radioClass || 'iradio_square-green' }).on('ifChanged', function(e) { scope.$apply(function() { update(e.target.checked); }); }); scope.$watch(attr.ngChecked, function(checked) { if(typeof checked === 'undefined') checked = !!ngModel.$viewValue; update(checked) }, true); scope.$watch(attr.ngModel, function(model) { $(element).iCheck('update'); }, true); }) } } }]) |
e4e496d13
|
50 |
})(); |