Fields
This attribute used to create the form fields with desired object list.
Type of the options is NgMatFormField.
Example.
import {NgMatFormOptions,NgMatFormFields} from 'ng-mat-forms';
// other imports here...
export class MyTestApp {
// Initialized a field list array which extended a
field interface.
public ngMatFormFields: NgMatFormFields[] = [{
type: 'input',
label: 'User Name',
placeholder: 'Enter a User Name',
formControlName: 'name'
// other options...
}, {
type: 'select',
label: 'Password',
placeholder: 'Enter a Password',
formControlName: 'password',
list: [
{
name: 'Option 1',
value: 'Option1',
type: 'option'
},
{
name: 'Option 2',
value: 'Option2',
type: 'option'
}
]
// other options...
}];
constructor() { }
}
Here are the articles in this section:
typelabelplaceholderformControlNamedirectiveregexdefaultValuevalidatorslistdisablelabelShowminDatemaxDatechangeEventsblurEventsmaxLengthminDategetListFromApiapiloadDepenentSelectOnChangeerrorMessageLast updated
Was this helpful?