OnChange
Angular has an event to identify any changes happening on the bounded properties of the component. So, whenever a property is modified, Angular will fire an OnChange event and pass the properties that are bound in the template.
In the OnChange event for each property, Angular will have a current and previous value which can then be used to identify the change and add logic. This event is mostly used when we want to handle some validations to the properties or any changes in the workflow, based on the value of the property.
In our Homepage component, we will use the OnInit life cycle hook to fetch the data for boards and bind that to the property. To be able to use the OnInit method, we first need to import the OnInit module from ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access