How to handle Namespaces while using Chaplinjs

22 views
Skip to first unread message

Nitin Arora

unread,
Feb 28, 2013, 8:56:34 PM2/28/13
to chapl...@googlegroups.com
Hi Folks,

I have just started using Chapling with JavaScript as the language for writing code. Question is how namespaces are handled while developing application using ChaplinJs?

Does Chaplinjs framework automatically takes care of the namespaces of the models, views and controllers and create them inside the extended application object OR we have to manage it manually?

e.g.

In my old project we used to have

(function(global) {
    who = global.mycompany || {};
    who.ui = {};
    who.app = who.app || {};
    who.models = {};
    who.templates = {};
})(typeof(window) === undefined ? this : window);

In our new Chaplin based project, we have just defined

var MyApplication = Chaplin.Application.extend({
//all init logic goes here

return MyApplication;
});

Thanks
Nitin








Mathias Schäfer

unread,
Mar 3, 2013, 12:33:12 PM3/3/13
to chapl...@googlegroups.com
Hi Nitin,

Am 01.03.13 02:56, schrieb Nitin Arora:
> Does Chaplinjs framework automatically takes care of the namespaces of
> the models, views and controllers and create them inside the extended
> application object OR we have to manage it manually?

See my answer on ost.io:
http://ost.io/chaplinjs/chaplin/topics/59

Regards,
Mathias
Reply all
Reply to author
Forward
0 new messages