DEV Community

Discussion on: ngOnChanges best practice - always use SimpleChanges - always

Collapse
 
sebavicentea profile image
Seba Vicente

In this case, isn't it better to use a setter for each @Input instead of listen to ngOnChanges?

Collapse
 
nickraphael profile image
Nick Raphael

I think that comes down to personal preference. Personally, I find Input getters and setters to be too verbose. I like all inputs handled in the same place.

Collapse
 
hankchiutw profile image
Hank Chiu

I find Input getters and setters to be too verbose

checkout subjectize, which wraps the setter under the hood and you don't need a private variable.