I created a web application using backbone.marionette . When from Marionette.ItemView I fire the document.location.hash event:
document.location.hash = '#tasks/' + this.model.get('id');
1.a) it changes the URL 1.b) it launches appRoutes
If I call Routing.navigate from the same place:
router.navigate('#tasks/' + this.model.get('id'))
2.a) it changes the URL as expected 2.b) it does not call appRoutes.
Any idea why 2.b happens? Where could the problem be?
Thanks.
var Router = Marionette.AppRouter.extend({ appRoutes: { 'tasks': 'tasks', 'tasks/:id': 'taskDetail', '*defaults': 'tasks' } });
source share