'Update DB table on browser close in angular 8 appliation

Have an angular 8 application and I have a scenario where users enters or leaves a specific page A, DB table is updated. But when the user close the browser from Page A, how to update the DB table?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source