I have a Backbone.Router class setup and everything is working perfectly. However, there is a little (maybe a bit blocking) inconvenience.
In order to navigate using the Backbone Router, I use the following code
myrouter.navigate('/search_term/2/filter1+filter2/');
This works as it should. However, the different parameters of the URL are not updated in the same place. For example, the user might move to the next page (3) and the search term and filters shouldn’t be updated.
What I want to be able to do is something like this
myrouter.navigate(':route_id', ':route_value');
For example, I can do
myrouter.navigate(':query', 'search_term');
myrouter.navigate(':pagination', '5');
Can Backbone do this? If not, any possible solutions?
I ended up fixing this myself.
The solution was to listen to the change of the models by binding to the change event in a similar fashion to what I do when submitting a request.