Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ViewChild('injectParameterInput', {read: ViewContainerRef}) parameterInputGroup;
- constructor(private cfr: ComponentFactoryResolver) {}
- addSourceForm = new FormGroup({
- url: new FormControl(''),
- parameters: new FormArray([])
- })
- addParameterInput() {
- const componentFactory = this.cfr.resolveComponentFactory(ParameterInputComponent)
- const compRef = this.parameterInputGroup.createComponent(componentFactory)
- let array = this.addSourceForm.controls.parameters as FormArray
- // array.push(new FormControl('')) ???
- compRef.instance.requestDestroy.subscribe(() => {
- compRef.destroy()
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement