The ContactsApp.Show Sub-Module

Learn how to create a sub-module to add the show functionality in Marionette.

Creating the Show controller

Since displaying a given contact is a different functionality than listing all the contacts, we’ll need a new submodule: ContactsApp.Show. Let’s start by creating the controller:

Press + to interact
ContactManager.module("ContactsApp.Show", function(Show, ContactManager,
Backbone, Marionette, $, _){
Show.Controller = {
showContact: function(model){
console.log("showContact called for model ", model)
}
}
});
...