-
Book Overview & Buying
-
Table Of Contents
Knockout.JS Essentials
By :
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.
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:

The workflow of the catalog module
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 the viewmodels folder and define a basic reveal...
Change the font size
Change margin width
Change background colour