formly-js / angular-formly-website

The website for angular-formly
http://angular-formly.com
18 stars 26 forks source link

Show/Hide group of fields #29

Closed sistemanick closed 9 years ago

sistemanick commented 9 years ago

I would like an example that demonstrates: showing and hiding a whole group of fields based on model values

e.g. { key: 'showGroup', type: 'checkbox', templateOptions: { label: 'Show group' } },
{ fieldGroup: [ { key: 'field1', type: 'input', templateOptions: { required: true, label: 'Field 1' } }, { key: 'field2', type: 'input', templateOptions: { required: true, label: 'Field 2' } }
], expressionProperties: { hide: '!model.showGroup' }
}

kentcdodds commented 9 years ago

Instead of expressionProperties, use hideExpression.

(Sent from my mobile device, please forgive typos or brevity) On Jun 4, 2015 5:58 PM, "sistemanick" notifications@github.com wrote:

I would like an example that demonstrates: showing and hiding a whole group of fields based on model values

e.g. { key: 'showGroup', type: 'checkbox', templateOptions: { label: 'Show group' } },

{ fieldGroup: [ { key: 'field1', type: 'input', templateOptions: { required: true, label: 'Field 1' } }, { key: 'field2', type: 'input', templateOptions: { required: true, label: 'Field 2' } }

], expressionProperties: { hide: '!model.showGroup' }

}

— Reply to this email directly or view it on GitHub https://github.com/formly-js/angular-formly-website/issues/29.

sistemanick commented 9 years ago

Cool that works. Thanks!