Marcos Basualdo Marcos Basualdo - 1 year ago 273
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download