Marcos Basualdo Marcos Basualdo - 5 months ago 52
AngularJS Question

Change route params without reloading in angular 2

i'm making a real estate website using angular 2, google maps, etc. and when a user changes the center of the map i perform a search to the api indicating the current position of the map as well as the radius. The thing is, i want to reflect those values in the url without reloading the entire page. Is that possible? I've found some solutions using angular 1.x but nothing about angular 2.


You could use location.go(url) which will basically change your url, without change in route of application.

NOTE this could cause other effect like redirect to child route from the current route.

Related question which describes location.go will not intimate to Router to happen changes.