Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
angular.module("checklist-model",[]).directive("checklistModel",["$parse","$compile",function(e,t){function c(e,t,c){if(angular.isArray(e))for(var r=e.length;r--;)if(c(e[r],t))return!0;return!1}function r(r,a,i){t(a)(r);var l=e(i.checklistModel),n=l.assign,o=e(i.checklistChange),h=e(i.checklistValue)(r.$parent),u=angular.equals;function s(e,t){r.checked=c(e,h,u)}i.hasOwnProperty("checklistComparator")&&(u=e(i.checklistComparator)(r.$parent)),r.$watch("checked",function(e,t){if(e!==t){var a,i,s,p=l(r.$parent);n(r.$parent,!0===e?(a=p,i=h,s=u,c(a=angular.isArray(a)?a:[],i,s)||a.push(i),a):function(e,t,c){if(angular.isArray(e))for(var r=e.length;r--;)if(c(e[r],t)){e.splice(r,1);break}return e}(p,h,u)),o&&o(r)}}),angular.isFunction(r.$parent.$watchCollection)?r.$parent.$watchCollection(i.checklistModel,s):r.$parent.$watch(i.checklistModel,s,!0)}return{restrict:"A",priority:1e3,terminal:!0,scope:!0,compile:function(e,t){if("INPUT"!==e[0].tagName||"checkbox"!==t.type)throw'checklist-model should be applied to `input[type="checkbox"]`.';if(!t.checklistValue)throw"You should provide `checklist-value`.";return e.removeAttr("checklist-model"),e.attr("ng-model","checked"),r}}}]);