changeEvents
Description
Hint
Fields: NgMatFormFields[] = [{
type: 'input',
label: 'User Name',
placeholder: 'Enter a User Name',
formControlName: 'name',
directive: 'numericOnly',
maxLength: '10',
validators: [Validators.required, Validators.email]
},{
type: 'checkBox',
label: 'Confirm Password',
placeholder: 'Enter a Password',
formControlName: 'checkbox',
list: [
{
name: 'Infinity War',
value: 'Avengers'
}
],
changeEvents: [{
// If the value is true the following operations happen
value: true,
// Array of formControl names which need to be disabled
disable: ['name'],
// Array of formControl names which need to be enabled
enable: ['name'],
//Array of FieldValueModel to set value for another controls of form group
setValue: [{ formControlName: 'name', value: 'Satheesh' }],
// Array of formControl names which validators to removed
removeValidators: ['name'],
//Array of FieldValueModel to set validators for another controls of form group
setValidators: [{ formControlName: 'name', validators: [Validators.required] }]
}]
}];Last updated