I think there is some missing code. I would expect to find something like this in the router:
var myController = {
listContacts: function () {
ContactManager.trigger("contacts:list");
}
};
ContactsApp.Router = Marionette.AppRouter.extend({
controller: myController,
appRoutes: {
"contacts": "listContacts"
}
});
Note that appRoutes
starts with a lowercase a.
Now the route contacts
will call the controller's listContacts
method and trigger the ContactManager.on("contacts:list"...
callback, running the appropriate API method.