new MustacheRenderer()
Is the bridge between the Shark main class and Mustache.
- Source:
Methods
render(jaw, options)
Takes a Jaw, get the template from Shark, put the dataObject from the Jaw into the template and add the rendered data into the container
passed in the options.
Parameters:
| Name |
Type |
Description |
jaw |
Jaw
|
The view to render. |
options |
object
|
The object with the options to setup the render.
Properties
| Name |
Type |
Description |
container |
string
|
The CSS selector to use to insert the rendered content. To place the content is used jQuery.html() method. |
|
- Source:
renderItem(options)
Takes an options object to render a template with some data into a specific container.
Parameters:
| Name |
Type |
Description |
options |
object
|
The object with the options to setup the render.
Properties
| Name |
Type |
Attributes |
Default |
Description |
append |
boolean
|
<optional>
|
false
|
If true, the rendered content is appended to the containerSelector parameter and will not replace its content. |
childTemplates |
object
|
<optional>
|
{}
|
An object that contains sub-templates data to be added to main template. |
containerSelector |
string
|
<optional>
|
""
|
The CSS selector used to insert the rendered content. To place the content is used jQuery.html() method.
If an empty string or other "falsable" value is passed, the rendered content is returned instead of being added to screen. |
renderItems |
object
|
<optional>
|
{}
|
An object containing data and functions to be rendered in the template. |
replace |
boolean
|
<optional>
|
false
|
If true, the containerSelector parameter is used to fully replace an item on the page instead of render inside that item. If this is set to true, the containerSelector parameter must be provided. |
templateSource |
string
|
|
|
A string containing an html source representing the template to be rendered. |
|
- Deprecated:
- - This method will be definitively removed in a future version.
- Source: