Reputation: 21840
I'm building a dashboard application with Backbone.js
There is a grid of panes called modules. Each module has its own custom data that it needs to listen to.
In this sense, I have created a backbone model called Module
that is basically the top-level information for each module like module_name
& module_description
my first inclination is to find a way to make a new special module model per module... like a "counter" module, a "messages" module, etc.
how should I approach the separate & different data per module? any design pattern recommendations?
Upvotes: 4
Views: 1605
Reputation: 785
You can do something like this:
var Module = Backbone.Model.extend({
// default properties/methods of this module
});
var MessageModule = Module.extend({
// new properties/methods of this module
});
Upvotes: 7