3 ms·
This is not the best example. You actually don't need to hardcode the html in the javascript. You can use a template system that is already included in backbon
by pdelgallego 16y ago
This is not the best example.
You actually don't need to hardcode the html in the javascript. You can use a template system that is already included in backbone, or you can preform a request to the server,
I prefer the first approach.
- ankimal 16y agoBackbone has built in support for templating. All you have to do is tell your View object what template it needs to render and you're on your way. Obviously, you can use whatever you are comfortable with: mustache, underscore, jTemplates etc.
- bricestacey 16y agoOr you can hardcode them using CoffeeScript's heredoc syntax.