backboneboilerplate icon indicating copy to clipboard operation
backboneboilerplate copied to clipboard

how to router.navigate ?

Open gorghoa opened this issue 13 years ago • 2 comments

Hi,

first of all, thanks for your boilerplate !

Maybe I’m thinking wrong, but I haven’t found the way yet to do a proper Backbone.Router.navigate(), since the router object is wrapped in a requirejs module.

My case is to redirect programmatically from a view to another. I could do it with window.location, but it doesn’t sound very smart…

Thanks for any help !

regards.

gorghoa avatar Nov 22 '12 09:11 gorghoa

I remember having this problem. With a bit of luck I found out that Backbone.history.navigate() works just as var router = new Backbone.Router(); router.navigate();

I'd assume you are always including Backbone so a simple Backbone.history.navigate('') should work.

thomasdavis avatar Nov 22 '12 09:11 thomasdavis

Hi,

thanks for your answer. I’ll try this ASAP !

regards.

gorghoa avatar Nov 22 '12 10:11 gorghoa