Using Backbone, Marionette (1.8.3), StickIt and TypeScript. How could I bind the lenght of a Backobone collection so that it gets update whenever items are added to or removed from the collection?
I'm quite new to StickIt and here what I have tried so far
export class SomeView extends marionette.CompositeView<backbone.Model, SomeItemView> {
(...)
bindings = {
"[data-bind-observer=count]": {
observe: ["collection.length"],
onGet: (collection) => {
return collection.length;
}
}
};
}