ng-mat-forms
  • Introduction
  • Installing
  • Getting Started
  • Attributes
    • Options
      • column
      • errorMsgOnSubmit
      • floatLabel
      • color
      • appearance
    • Fields
      • type
      • label
      • formControlName
      • directive
      • placeholder
      • regex
      • defaultValue
      • validators
      • list
      • disable
      • labelShow
      • minDate
      • maxDate
      • changeEvents
      • blurEvents
      • maxLength
      • minLength
      • getListFromApi
      • api
      • loadDepenentSelectOnChange
      • errorMessage
  • Callbacks
    • formFieldsChange
    • formChange
    • formSubmit
  • Apis
    • setControlValue
    • setFormValue
    • setControlDisable
    • setControlEnable
    • setValidator
    • removeValidator
Powered by GitBook
On this page

Was this helpful?

  1. Attributes

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:

PreviousappearanceNexttype

Last updated 5 years ago

Was this helpful?

type
label
placeholder
formControlName
directive
regex
defaultValue
validators
list
disable
labelShow
minDate
maxDate
changeEvents
blurEvents
maxLength
minDate
getListFromApi
api
loadDepenentSelectOnChange
errorMessage