我的组件中有一个反应形式,我想在每个输入上设置触摸属性等于true.我当前的代码是这样,但它抛出了我的错误无法设置#< AbstractControl>触及的属性它只有一个吸气剂:
addressForm: FormGroup; ... this.addressForm = this._fb.group({ street: ["",[<any>Validators.required]],city: ["",state: ["",zipCode: ["",country: ["",[<any>Validators.required]] }); ... for (var key in this.addressForm.controls) { this.addressForm.controls[key].touched = true; }
如何将每个输入的触摸值设置为true?