jonnyreeves/jquery-Mustache — pull request #34 by PauliusKuras (2014-06-04 17:32:00+00:00)
Title: Added support for partials object

jQuery Mustache plugin was missing support for partial objects which are supported by Mustache. From Mustache docs:

> In mustache.js an object of partials may be passed as the third argument to `Mustache.render`. The object should be keyed by the name of the partial, and its value should be the partial text.

> ```js
> Mustache.render(template, view, {
> user: userTemplate
> });
>```

The patch adds support for such object. This allows to choose partial templates dynamically. For example, if template has partial with name `{{> content}}`, it is now possible to render some differently named template in place of this partial.

Here's an usage example:

```html

```
```js
$('body').mustache('div', {}, {}, {content: 'content1'});
$('body').mustache('div', {}, {}, {content: 'content2'});
```
And the result:
```
Div content: Hello world!
Div content: Bye world!
```