Recently, I have started working on a project and in the code base I am finding lots of this.module statements (not this.model). As a beginner in backbone, I have no idea when should I use this and why? Any explanation would be really helpful.
Asked
Active
Viewed 92 times
0
-
`this.module` or `this.model`? – SteamDev Dec 23 '14 at 20:14
-
That's probably something specific to your code base. There are only two mentions of "module" in the current Backbone source code and they're both in comments. – mu is too short Dec 23 '14 at 20:34
-
@muistooshort that might be correct. I will talk to my UI lead then. Thanks a lot :) – Sharif Mamun Dec 23 '14 at 20:44
-
1Might be something from Marionette too, I don't use Marionette but many Backbone people do. – mu is too short Dec 23 '14 at 21:10
1 Answers
1
Modules come from Marionette.js
Marionette Modules allow you to create modular encapsulated logic. They can be used to split apart large applications into multiple files, and to build individual components of your app.
Here is a docs

aleha_84
- 8,309
- 2
- 38
- 46
-
Thanks, that's perfect. It inherits things from other classes so that we don't need to define/write the same things again and again. – Sharif Mamun Dec 25 '14 at 19:00