是否可以在angular2中设置为无效的表单控件? (用过的表单构建器)
eg. i have form-> exampleFrom & field-> exampleControl
我试过这个,没有成功:
this.exampleFrom.controls['exampleControl'].invalid
尝试
原文链接:https://www.f2er.com/angularjs/240435.htmllet control = this.exampleFrom.controls['exampleControl']; control.setErrors({backend: {someProp: "Backend message"}}); let message = control.errors['backend'].someProp;