Skip to content

Instantly share code, notes, and snippets.

@KerryRitter
Created May 12, 2016 14:15
Show Gist options
  • Save KerryRitter/48be74ec1f7cad763d8ee21d66a16b10 to your computer and use it in GitHub Desktop.
Save KerryRitter/48be74ec1f7cad763d8ee21d66a16b10 to your computer and use it in GitHub Desktop.
Bootstrap Checkbox Angular 1.5 Typescript
export class Checkbox implements ng.IComponentOptions {
public bindings: any = {
ngModel: "=",
defaultValue: "<",
label: "<"
};
public template: string = `
<div type="button"
class="btn btn-default"
ng-init="$ctrl.ngModel = false"
ng-click="$ctrl.ngModel = !$ctrl.ngModel">
<span ng-class="{
'glyphicon glyphicon-check': $ctrl.ngModel,
'glyphicon glyphicon-unchecked': !$ctrl.ngModel,
}"></span>
{{::$ctrl.label}}
</div>`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment