Last active
August 15, 2022 20:32
-
-
Save djabif/952874969d3af3023beb16deac0659f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ng-container *ngFor="let control of jsonFormData?.controls"> | |
<label class="block mt-6" for="{{ control.name }}">{{ | |
control.label | |
}}</label> | |
<input | |
*ngIf=" | |
[ | |
'text', | |
'password', | |
'email', | |
'number', | |
'checkbox', | |
'tel', | |
'url' | |
].includes(control.type) | |
" | |
[type]="control.type" | |
[formControlName]="control.name" | |
[value]="control.value" | |
/> | |
<textarea | |
*ngIf="control.type === 'textarea'" | |
[formControlName]="control.name" | |
[value]="control.value" | |
></textarea> | |
<select | |
*ngIf="control.type === 'select'" | |
[formControlName]="control.name" | |
[value]="control.value" | |
> | |
<option *ngFor="let option of control.options" [value]="option"> | |
{{ option }} | |
</option> | |
</select> | |
</ng-container> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment