app .directive('iCheck', function ($location) { return { require: ['^form', 'ngModel'], restrict: 'C', scope: { ngModel: '=' }, link: function ($scope, $element, attrs, ctrls) { var ngModel = ctrls[1]; $scope.$watch('ngModel', function (d) { $element.iCheck('update'); }); $element.iCheck({ checkboxClass: 'icheckbox_minimal-blue' }); $element.on('ifChanged', function (event) { $scope.$apply(function () { ngModel.$setViewValue($element.is(':checked')); }); }); } }; });