Constructor
new View(appInstance)
Constructor
Parameters:
Name | Type | Description |
---|---|---|
appInstance | App | App reference |
- Source
Methods
compile(template, opts) → {*}
Compiles template with given options
Parameters:
Name | Type | Description |
---|---|---|
template | string | EJS based template |
opts | object | EJS template options. @see https://ejs.co/#docs |
- Source
Returns:
- Compiled template function
- Type:
- *
getHtml(tmpl, data, tmplOptions) → {string}
Generate HTML from given template string and data
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tmpl | |||
data | |||
tmplOptions | null |
- Source
Returns:
- Generated HTML
- Type:
- string
render(container, tmpl, dataopt, forceRepaintopt, tmplOptionsopt)
Renders template with given data to html container.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
container | HTMLElement | | Container in which template should be rendered. | ||
tmpl | string | EJS template string | ||
data | object | <optional> | {} | Template data. |
forceRepaint | boolean | <optional> | false | If false, DOM diffing is enabled. |
tmplOptions | object | <optional> | null | EJS template options. @see https://ejs.co/#docs |
- Source
renderHtml(container, html)
Parameters:
Name | Type | Description |
---|---|---|
container | HTMLElement | | Container in which template should be rendered. |
html | string | HTML string to be rendered |
- Source
setWindowTitle(title)
Sets window title
Parameters:
Name | Type | Description |
---|---|---|
title | string | Title to set |
- Source