Issue
I am using angular 2 with hashlocation strategy.
The component is loaded with that route:
"departments/:id/employees"
So far fine.
After I do a successful batch save of multiple edited table rows I want to reload the current route URL via:
this.router.navigate([`departments/${this.id}/employees`]);
But nothing happens, why?
Solution
If your navigate() doesn't change the URL that already shown on the address bar of your browser, the router has nothing to do. It's not the router's job to refresh the data. If you want to refresh the data, create a service injected into the component and invoke the load function on the service. If the new data will be retrieved, it'll update the view via bindings.
Answered By - Yakov Fain
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.