Skip to content

Instantly share code, notes, and snippets.

@santagada
Created November 21, 2013 16:42
Show Gist options
  • Save santagada/7585189 to your computer and use it in GitHub Desktop.
Save santagada/7585189 to your computer and use it in GitHub Desktop.
app.directive('checkbox', function(){
return {
restrict: 'E',
require: 'ngModel',
scope: {
options: '=',
checked: '=ngModel',
label: '=label'
},
/*jshint multistr: true */
template: ' \
<label class="checkbox" ng-class="{checked: checked}" ng-click="checked = !checked"> \
<span class="icons"> \
<span class="first-icon icon-check-empty"></span> \
<span class="second-icon icon-check"></span> \
</span> \
<input type="checkbox" ng-model="checked"/>{{ label }} \
</label>',
replace: true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment