Getting Started
To use ng-mat-forms define the application class as follows:
import {NgMatFormOptions,NgMatFormFields} from 'ng-mat-forms';
// other imports here...
export class MyTestApp {
public ngMatFormsOptions: NgMatFormOptions = {
column: 3
// other options...
};
// 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: 'Infinity War',
value: 'Avengers',
type: 'option'
},
{
name: 'End Game',
value: 'Avengers',
type: 'option'
}
]
// other options...
}];
constructor() { }
}
<ng-mat-forms [Fields]='ngMatFormFields'
[options]='ngMatFormsOptions'></ng-mat-forms>
and you're ready to use.
Last updated
Was this helpful?