Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// dynamic-form-control.component.ts
import { DynamicControlConfig } from './../dynamic-control.config';
import { FormGroup } from '@angular/forms';
import { Component } from '@angular/core';
@Component({
// tslint:disable-next-line:component-selector
selector: 'dynamic-form-control',
template: `
<div [formGroup]="formGroup" class="form-group">
<label>{{controlConfig.label}}</label>
<input [type]="controlConfig.type" class="form-control"
[placeholder]="controlConfig.placeholder" [formControlName]="controlConfig.name">
</div>
`
})
export class DynamicFormControlComponent {
formGroup: FormGroup;
controlConfig: DynamicControlConfig;
constructor() { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.