可以订阅对NgForm
的valueChanges
observable属性的回调,以便对表单控件值的更改做出react .
我需要以同样的方式对用户touching one of the form controls的事件做出react .
This class似乎定义了valueChanges
个可观察属性,touched
属性定义为布尔值.
Is there a way to to react to the "control touched" event?
可以订阅对NgForm
的valueChanges
observable属性的回调,以便对表单控件值的更改做出react .
我需要以同样的方式对用户touching one of the form controls的事件做出react .
This class似乎定义了valueChanges
个可观察属性,touched
属性定义为布尔值.
Is there a way to to react to the "control touched" event?
ng2没有提供直接的方式来对touch 事件做出react .它使用(input)事件触发valueChanges事件,使用(blur)事件设置AbstractControl的touched/untouched属性.