I have got 2 components, let's say, Component A
is a list view and Component B
is a details view. Each row from the list view is clickable and will redirect to Component B
upon clicking.
Component B
allows editing and saving the details. I have added a Back
button to Component B
to allow me to go back to the list view.
But the problem I am having is that I can't see the updated list view and have to manually refresh the browser, and then I can see the updated list there.
I have tried directly using window.location
and it works but really I don't prefer this approach.
public back() {
window.location.assign('/listview');
}
I wonder if there's any better way to solve this problem?
Update:
public onSelected(model: MyModel) {
const detailsViewUrl = `/detailsview/${model.id}`;
this._router.navigateByUrl(detailsViewUrl );
}