我在子表单组件中有一个按钮,在from父组件中,我想在子组件中单击onClose()函数时将函数推送到子组件.我已经尝试了下面的方法,但问题是它将在第一个表单上工作,但不会在其余表单上工作.我也想传递其他功能,包括onSubmit.对我来说,我需要弄清楚我在这里做错了什么.我已经在这几天了,现在任何帮助都表示赞赏.谢谢
child form component, in the template url it contains the button for Onclose()
import { Component, OnInit, NgModule, Input, ViewChild, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder, FormControl, Validators, AbstractControl, ValidatorFn,Form } from '@angular/forms';
import { BsDatepickerConfig } from 'ngx-bootstrap/datepicker';
@Component({
selector: 'app-editgraphs',
templateUrl: './editgraphs.component.html',
styleUrls: ['./editgraphs.component.scss']
})
export class EditgraphsComponent implements OnInit {
@Input() eGraphtitle: string;
@Output() close: EventEmitter<any> = new EventEmitter();
graphDataForm: FormGroup;
constructor(private fb: FormBuilder,){}
ngOnInit(): void {
this.graphDataForm = this.fb.group({
sDepartment: new FormControl(null, …Run Code Online (Sandbox Code Playgroud) angular6 ×1