|
1 | 1 | angular.module('schemaForm') |
2 | | - .config([ 'schemaFormDecoratorsProvider', function(decoratorsProvider) { |
| 2 | + .config([ 'schemaFormDecoratorsProvider', 'sfBuilderProvider', |
| 3 | +function(decoratorsProvider, sfBuilderProvider) { |
3 | 4 | var base = 'decorators/material/'; |
4 | 5 |
|
| 6 | + var simpleTransclusion = sfBuilderProvider.builders.simpleTransclusion; |
| 7 | + var ngModelOptions = sfBuilderProvider.builders.ngModelOptions; |
| 8 | + var ngModel = sfBuilderProvider.builders.ngModel; |
| 9 | + var sfField = sfBuilderProvider.builders.sfField; |
| 10 | + |
| 11 | + var defaults = [ sfField, ngModel, ngModelOptions ]; |
| 12 | + |
5 | 13 | decoratorsProvider.defineDecorator('materialDecorator', { |
6 | | - textarea: { template: base + 'textarea.html' }, |
7 | | - fieldset: { template: base + 'fieldset.html' }, |
8 | | - 'default': { template: base + 'default.html' }, |
9 | | - select: { template: base + 'select.html' }, |
10 | | - checkbox: { template: base + 'checkbox.html' }, |
11 | | - checkboxes: { template: base + 'checkboxes.html' }, |
12 | | - radios: { template: base + 'radios.html' }, |
13 | | - 'radios-inline': { template: base + 'radios-inline.html' }, |
14 | | - radiobuttons: { template: base + 'radio-buttons.html' }, |
15 | | - submit: { template: base + 'submit.html' } |
| 14 | + textarea: { template: base + 'textarea.html', builder: defaults }, |
| 15 | + fieldset: { template: base + 'fieldset.html', builder: [ sfField, simpleTransclusion ] }, |
| 16 | + 'default': { template: base + 'default.html', builder: defaults }, |
| 17 | + select: { template: base + 'select.html', builder: defaults }, |
| 18 | + checkbox: { template: base + 'checkbox.html', builder: defaults }, |
| 19 | + checkboxes: { template: base + 'checkboxes.html', builder: defaults }, |
| 20 | + radios: { template: base + 'radios.html', builder: defaults }, |
| 21 | + 'radios-inline': { template: base + 'radios-inline.html', builder: defaults }, |
| 22 | + radiobuttons: { template: base + 'radio-buttons.html', builder: defaults }, |
| 23 | + submit: { template: base + 'submit.html', builder: defaults } |
16 | 24 | }); |
17 | 25 |
|
18 | 26 | /* decoratorsProvider.createDecorator('materialDecorator', { |
|
0 commit comments