import { Component } from '@angular/core' ; import { FormGroup } from '@angular/forms' ; import { FormlyFormOptions , FormlyFieldConfig } from '@ngx-formly/core' ; import { NzExampleBaseComponent } from '../common/base' ; @ Component ( { selector : 'formly-app-example' , templateUrl : './app.component.html' , } ) export class AppComponent extends NzExampleBaseComponent { form = new FormGroup ( { } ) ; model : any = { } ; options : FormlyFormOptions = { } ; fields : FormlyFieldConfig [ ] = [ { key : 'Input' , type : 'input' , templateOptions : { label : 'Input' , placeholder : 'Placeholder' , description : 'Description' , required : true , } , } , ] ; fieldsTo = [ ] ; mapFields = ( ) => { const fields = this . fields [ 0 ] . templateOptions ; fields . type = fields . passwordModel ? 'password' : 'text' ; } ; }