How to generate forms dynamically by angular4

how do I generate different forms based on the data passed in the background? Such as user registration and user login, dynamic generation of form components?

Mar.14,2021

globally define a FormGroup ,
and then dynamically add FormControl to FormGroup based on different data.

public formGroup: FormGroup;

this.xxxService.getData().subscribe((data: Array<string>) => {
    this.formGroup = new FormGroup({});
    data.forEach((key: string) => {
        this.formGroup.addControl(key, new FormControl(''));
    });
});

to see the response form


you can use form-create to dynamically create form forms based on parameters, supporting check box, radio box, input box, drop-down selection box and other elements, as well as, provinces and cities three-level linkage, time selection, date selection, color selection, file / picture upload function. github address

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38737-2b890.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38737-2b890.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?