AbstractControl.setErrors在angular 2中不起作用

AbstractControl.setErrors在angular 2中不起作用,angular,angular2-forms,Angular,Angular2 Forms,@ViewChild('adjustmentTemplateForm') 私人调整模板格式:NgForm; onInputChanged():void{ 让formField:AbstractControl=this.adjustmentTemplateForm.form.controls[parameterValueField]; 如果(1==1){ formField.setErrors({ “不唯一”:正确 }); parameterValueObject.isParameterValue

@ViewChild('adjustmentTemplateForm')
私人调整模板格式:NgForm;
onInputChanged():void{
让formField:AbstractControl=this.adjustmentTemplateForm.form.controls[parameterValueField];
如果(1==1){
formField.setErrors({
“不唯一”:正确
});
parameterValueObject.isParameterValueValid=false;
}否则{
this.form.setErrors(null);
parameterValueObject.isParameterValueValid=true;
}
}


能否创建一个plunker,我无法将这两个代码片段拼凑在一起,唯一的共同点是表单名称:)我遇到了同样的问题,您解决了吗?有解决方案吗?