#Change detection with OnPush on FormControl

11 messages Β· Page 1 of 1 (latest)

ruby dawn
#

Hi it's on purpose or you would not be able to update the template to display error messages for example without custom change detection manual action.

civic wing
#

Is there any way i could "opt out" from this behavior or something?

ruby dawn
civic wing
ruby dawn
#

And to act only when necessary means you need a local state to store the previous computation result: if the form is valid, you need to know if it was valid or invalid on previous valueChanges/statusChanges

civic wing
# ruby dawn Not the entire view, only the bad boys not using OnPush. About knowing if stuff ...

True. It most likely won't have significant impact on performance unless your using Default detection & binding functions in your views etc. (but then you have bigger issues to work on anyways πŸ˜… )
I just got curios why i got so many logs emitted when checking how many times the event got triggered & that led to that question πŸ™‚

In case your wondering. In my particular scenario its just a simple input field that acts as a filter so i don't really care about the validity since any input is valid in there.

#

Really appreciate the discussion πŸ™‚

ruby dawn
#

The control you can have over your form is through the updateOn option but only change|submit|blur options are availables

civic wing