Created
May 12, 2016 14:15
-
-
Save KerryRitter/48be74ec1f7cad763d8ee21d66a16b10 to your computer and use it in GitHub Desktop.
Bootstrap Checkbox Angular 1.5 Typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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