Skip to content

Instantly share code, notes, and snippets.

@isummation
Last active September 14, 2017 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isummation/748cffda2373bb43fb0a6ba1a97846c4 to your computer and use it in GitHub Desktop.
Save isummation/748cffda2373bb43fb0a6ba1a97846c4 to your computer and use it in GitHub Desktop.
// 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