I'm wonder if there's a way to know the difference whether valueChanges on a FormControl was triggered from the dom or the component itself. My use case is I need to do stuff() when the user changes the value, but I don't want to do stuff() if the value changed as a result of something else. Any thoughts?
-
I don't understand the downvotes. This is an interesting question. Unfortunately I am pretty sure that this kind of API does not exist.Tomasz Kula– Tomasz Kula2018-04-11 22:03:41 +00:00Commented Apr 11, 2018 at 22:03
Add a comment
|
2 Answers
with the control ".touched"
EXAMPLE: YourModelForm.get('YourField').touched
the value becomes true when the user enters a value (first click on the field, enter the value, tab or click out of the field).
I tried with a call rest and the value remains to false, try it if you can possibly it works for your situation. :-)