Monday, 9 September 2013

What is the best way to add server variables (PHP) in to the Backbone.model using require.js?

What is the best way to add server variables (PHP) in to the
Backbone.model using require.js?

I'm not sure what is the elegant way to pass server variables in to my Model.
For example, i have an id of user that has to be implemented on my Model.
But seems like Backbone with require are not able to do that.
My two options are:
Get a json file with Ajax.
Add the variable on my index.php as a global.
Someone know if exists a other way. Native on the clases?

No comments:

Post a Comment