derickbailey/backbone.marionette — Issue #33: Support raw HTML strings with TemplateManager.
Author: baalexander
Created: 2012-02-24 20:38:20+00:00
State: open

It would be great if a raw HTML string (say, `'

Hello

'`) could be passed to `template` for CollectionViews and ItemViews and as a parameter TemplateManagers.get().

Example:

```javascript
var Item = Backbone.Marionette.ItemView.extend({
template: '

Hello

'
});
```

Right now (as far as I know) you have to create a jQuery object with a wrapper element since .html() is called.

```javascript
var Item = Backbone.Marionette.ItemView.extend({
template: function() {
var wrapper = $('

');
wrapper.append('

Hello

');
return wrapper;
}
});
```

**Who would use this?**

Anyone who gets raw HTML strings. I personally get the HTML as a string with require.js and the [text](http://requirejs.org/docs/download.html#text) plugin. Others may be getting the HTML from an ajax call.

Thanks!