Last active
September 14, 2017 07:33
-
-
Save isummation/748cffda2373bb43fb0a6ba1a97846c4 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
// 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