The main thing used in the Angular filter isngOnInit(). Angular 2 has life cycle hooks that we can use to control how and when data bindings are updated. ThengOnInit()is invoked immediately after the firstngOnChanges(), and before thengDoCheck(). ...
If we have some logic inside child components and we want to execute that logic as soon as decorator parameters are modified, we can use ngOnChanges() lifecycle hook. If we need to clean up some resources as soon as our component is destroyed, we should use ngOnDestroy() lifecycle hook....
TheOnPushmethod changed it because with this strategy, Angular reacts only to input changes and events. However, it’s not a perfect solution, and having to choose betweenngOnChanges, get/setters for inputs, andObservablesandSubjectsisn’t really fun. All of these approaches come with more ...