forked from xialeistudio/angular-icheck
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.ts
36 lines (35 loc) · 1.44 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
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
// /**
// * @author xialei <xialeistudio@gmail.com>
// */
// angular.module('angular-icheck', [])
// .directive('iCheck', [function () {
// return {
// restrict: 'EA',
// transclude: true,
// require: 'ngModel',
// replace: true,
// template: '<div class="angular-icheck">\n <div class="checkbox"></div>\n <div class="label" ng-transclude></div>\n</div>',
// link: function (scope, ele, attrs, ctrl) {
// var box = angular.element(ele[0].querySelector('.checkbox'));
// ele.bind("click", function () {
// box.toggleClass("checked");
// ctrl.$setViewValue(box.hasClass("checked"));
// });
// ctrl.$render = function () {
// if (ctrl.$viewValue) {
// box.addClass("checked");
// } else {
// box.removeClass("checked");
// }
// };
// // https://github.com/angular/angular.js/issues/2594
// // override $isEmpty method
// ctrl.$isEmpty = function(value) {
// return value === false;
// };
// ctrl.$setViewValue(box.hasClass("checked"));
// ctrl.$validate();
// }
// }
// }]);
export * from './dist/ng2-icheck.module';