I am new to Marionette but not Javascript and there's something I don't understand about the router and calling 'navigate'
Here's my application object. You'll note that in some cases I have opted to attach my objects to a global namespace (in my case an object called "MW")
Other than that, this should be implemented a fairly standard way
Here's the application object:
Here's the router:
The initializer for this is very simple:
$(function(){
MW.app = new MW.Application();
MW.app.start();
});
Here's what I don't understand:
When I call MW.appRouter.navigate(dest, {trigger: true}); -- on lines 53, 61, or 70 --- my URL changes but the controller action (line 9) does not fire at all.
However, if I go to to console while the app is booted I can call MW.appRouter.navigate("/", {trigger: true}); and my controller actions fire fine (I get logging output that I had defined in my controller methods)
It appears to me that the only difference is where I call it: Either in javascript code or on the browser developer console. One way (the former) changes the URL and does NOT call the controller methods, whereas the latter changes the URL and does call the controller methods.
I tried this with an without trigger: true (isn't Marionette supposed to make that unneeded?) but I got the same results both ways.
Please let me know what I'm missing.
Jason