Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit 7c1865c

Browse files
author
Kamil Kisiela
committed
feat(switch): templateOptions.disabled
1 parent 27d1d2a commit 7c1865c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/types/switch/switch.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ import template from './switch.html';
33
export default (formlyConfigProvider) => {
44
formlyConfigProvider.setType({
55
template,
6-
name: 'switch'
6+
name: 'switch',
7+
defaultOptions: {
8+
templateOptions: {
9+
disabled: false
10+
},
11+
ngModelAttrs: {
12+
disabled: {
13+
bound: 'ng-disabled'
14+
}
15+
}
16+
},
17+
apiCheck: (check) => ({
18+
templateOptions: {
19+
disabled: check.bool.optional
20+
}
21+
})
722
});
823
};

0 commit comments

Comments
 (0)