angular - How to detect browser back button click in Angular2 -
i want clear localstorage data on browser button click. how detect browser button click in angular2. not getting exact solution. can please tell me how this?
you can use ngondestory method of components part of component life cycle.
this component called whenever component destroyed.
what can create service logic clean localstorage written.
call service on ngondestory method of component.
hope helps.
Comments
Post a Comment