Skip to content

Commit c68a3f4

Browse files
committed
First stab at a checkbox
Needed to wrap it in a div for the transcluded content (the label) to get the right scope.
1 parent 12c59fd commit c68a3f4

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/checkbox.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<div class="checkbox schema-form-checkbox {{form.htmlClass}}">
2+
<md-checkbox sf-changed="form"
3+
ng-disabled="form.readonly"
4+
schema-validate="form"
5+
name="{{form.key.slice(-1)[0]}}"
6+
ng-model="$$value$$" aria-label="{{::form.title}}">
7+
<span ng-bind-html="form.title"></span>
8+
</md-checkbox>
9+
<div ng-messages="ngModel.$error">
10+
<!--
11+
This is a bit of a hack. sf-message does the work, but ng-messages and ng-message
12+
is needed for the styling
13+
-->
14+
<div sf-message ng-message></div>
15+
</div>
16+
</div>
17+
<!--
118
<div class="checkbox schema-form-checkbox {{form.htmlClass}}"
219
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
320
<label>
@@ -13,3 +30,4 @@
1330
</label>
1431
<div class="help-block" sf-message="form.description"></div>
1532
</div>
33+
-->

src/material-decorator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ angular.module('schemaForm').config(['schemaFormDecoratorsProvider', function(de
33

44
decoratorsProvider.defineDecorator('materialDecorator', {
55
textarea: {template: base + 'textarea.html'},
6+
checkbox: {template: base + 'checkbox.html'},
67
'default': {template: base + 'default.html'},
78
submit: {template: base + 'submit.html'}
89
});

0 commit comments

Comments
 (0)