I'm working on a currency converter, and I have url like #/currency/50/USD/to/EUR
, where 50, USD and EUR are parameters. Now I have a switch function which swaps the currencies and keep the value to convert, I'd like to change the URL as well to something like #/currency/50/EUR/to/USD
without reloading the controller, just change the hash. I have an idea on how to do with pure js, but is there any solution in angular way?
Check this answer out. It sounds just like what you need.
Basically, you seem to have two choices:
$locationChangeSuccess
event.$routeProvider
definition, while defining the routes and the corresponding templated to load, specify the option reloadOnSearch = false
. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With