February 2019
Beginner
694 pages
18h 4m
English
For our sample application, we will build three Backbone models. One model will be for each item in our IClickableItem array, and will be called the ItemModel model. The second model will be for the collection of ItemModels, and the third model will be used for the SelectedItem and Title properties. Let's first take a look at the ItemModel, as follows:
class ItemModel extends Backbone.Model
implements IClickableItem {
get Id() {
return this.get('Id');
}
set Id(value: number) {
this.set('Id', value);
}
get DisplayName() {
return this.get('DisplayName');
}
set DisplayName(value: string) {
this.set('DisplayName', value);
}
constructor(input: IClickableItem) {
super();
this.set(input);
}
}
Here, we have a class named ItemModel ...
Read now
Unlock full access