I have a website developed in angular 2. When I provide optional parameters to it in chrome e.g.
https://aglplus-ui-demo.azurewebsites.net/home?error_code=10000&tra
If you have a path with a hash parameter and query parameters and you want to use 'navigate' method, you have to use the following form:
router.navigate([path], {queryParams: queryParams, fragment: fragment, relativeTo: route});
Or, as answered @krishanu-choudhury, you can use the
router.navigateByUrl()
method.