February 2019
Beginner
694 pages
18h 4m
English
Having created two models, a collection of models, and two views, we will now create a controller to bind these elements together. Backbone, however, does not have a specialist controller class, but we can use a standard TypeScript class to accomplish the work of a controller. This class will be named ScreenViewApp, as follows:
class ScreenViewApp { start() { let itemCollection = new ItemCollection(ClickableItems); let collectionItemViewModel = new ItemCollectionViewModel({ Title: "Please select :", SelectedItem: { Id: 0, DisplayName: 'None Selected:' } }); let itemCollectionView = new ItemCollectionView( { model: collectionItemViewModel }, itemCollection ); $(`#pageLayoutRegion`).html( itemCollectionView.render().el ...Read now
Unlock full access