I would like to save some Angular 2 component related data to the database just before navigating from that particular component to another component so that database saved data will be able to display on the second component. In order to do that I called the save method on ngOnDestroy() hook of the first component and display method on second component ngOnInit().
However, It looks like ngOninit() calls before ngOnDestroy() completely finished. It means before saving data into the database second component retrieve old data and displaying.
Please help me to resolve this issue.