The navigation and shell templates
As we did in Chapter 7, Durandal – The KnockoutJS Framework, we are going to compose our shell.html
view in two parts: shell.html
and navigation.html
.
The catalog module
In the Knockout cart, we have a view-model that manages all parts of the application. Here we are going to split that big view-model into several parts. The first part is the catalog.
Here we have a schema of how it should work:
Catalog will contain just the partial that includes the search bar and the table with its actions. This makes the view-model smaller and therefore more maintainable.
Although files will be split into different folders, catalog is a module by itself. It contains the view-model, the view, and some services that will only work inside this module. Other components will be required, but they will be shared by more modules along the live cycle of the application.
Create a file named
catalog.js
in theviewmodels
folder and define a basic reveal...