lundi 3 décembre 2018

Separate Backbone View functions into separate files

I have a Backbone View.

To organize better the code of it, I would to prefer to separate some functions of it into a separate file.

So, I would like to maintains the structure but simply I need to separate the functions into different files:

- MyView
   - functions A -> file A;
   - functions B -> file B;

I would like to use the view in the same current mode. So I need to call the functions 'A' on my view: myViewInstance.functionA_1()

What is the correct way/pattern to implement this?

I use also RequireJS.

Aucun commentaire:

Enregistrer un commentaire