Reputation: 1363
I would like to use external file for templating in backbonejs. I searched in google but could not find any suitable solution.
Could anyone say how to do that ??
Upvotes: 0
Views: 81
Reputation: 387
Try declaring the templates in a new jsp file and include it in main jsp file. The backbonejs view declared for main jsp can render these new templates.
Upvotes: 1
Reputation: 23803
By external file, you mean storing the template in html files and read it? If so, you need one of the module loaders such as RequireJS (See the requirejs text plugin) or browserify (with the stringify middleware).
Upvotes: 1