I want to reload my page route to refresh data stored in it. I can do this with putting routerLink
on html but is there away that I can make this into a function in ts file? I have found location.reload
and location.href
but they refresh the whole page.
Code to retrieve message
receiveMessage(){
this.angularFiremessaging.messages.subscribe(
(payload) => {
console.log("new message received. ", payload);
this.currentMessage.next(payload);
});
}
My html
{{ (message | async)?.notification.title }}
{{ (message | async)?.notification.body}}