Skip to content

Instantly share code, notes, and snippets.

View camilogiraldo's full-sized avatar

Camilo Giraldo camilogiraldo

View GitHub Profile
<form [formGroup]="form" (submit)="submitForm()">
<ng-template ngFor let-input [ngForOf]="formData">
<ng-container [ngSwitch]="input.controlType">
<ng-template [ngSwitchCase]="'text'">
<div class="form-group">
<label [for]="input.controlName"> {{input.controlName}}</label>
<input [formControlName]="input.controlName" [type]="input.valueType" [name]="input.controlName"
[required]="input.validators.required" [minlength]="input.validators.minlength"
<app-dynamic-form></app-dynamic-form>
@camilogiraldo
camilogiraldo / Angular2-solution.md
Created August 15, 2019 18:48
Angular 2 solution