GN.
GN.

Reputation: 9819

Navigate back index on backbone router

Trying figure out how to trigger an index route in Backbone.

routes:     
    '': 'home'    
    profile': 'init_profile'

and then in Chrome console..

app_router.navigate('', { trigger: true, replace: true });

Does not change URL or fire any callbacks.

However, the profile route works fine:

app_router.navigate('profile', { trigger: true, replace: true });

How do I trigger the index route?

Upvotes: 0

Views: 750

Answers (2)

GN.
GN.

Reputation: 9819

Backbone.history.navigate('', true)

Seems to work.

Upvotes: 1

Pablo
Pablo

Reputation: 1141

You should use just:

app_router.navigate('profile', true);

It should work that way.

Upvotes: 1

Related Questions