2017-07-13 51 views
3

我想要一種方法來從窗體控件中刪除特定的錯誤,而不是清除所有錯誤。角度抽象控制刪除錯誤

control.setError({'firstError': true}) 

,並刪除特定的錯誤,如

control.removeError({'firstError}) and not control.setError({null}) 

我試圖

control.setError({'firstError': false}) 

,但沒有奏效。

任何幫助。由於

角4.1.1

回答

3

您可以刪除這樣的:

control.setError({'firstError': null}) 
+0

非常感謝。你是救命吧 – phacic

+0

我相信它是'control.setErrors({'firstError':null})' – Mattijs