In the previous chapter, we looked at Knockout's new components feature, which lets us construct view/viewmodel pairs by instantiating them from the DOM with custom elements (or bindings). Knockout released this feature after Durandal, so there is some overlap between the two. Durandal's composition is like a blend of the components and the template binding.
Composition is primarily invoked in two ways, with
setRoot to compose the
applicationHost ID, and with the compose binding for data-bound values. Composition works by pairing a viewmodel with a view.
Durandal's documentation refers to viewmodels as modules, which I think is a bit confusing. I will be referring to composable modules as viewmodels throughout this chapter. ...