.insertTemplateLib - PeterNaydenov/code-assembly-line GitHub Wiki
Insert templates in a separate namespace. If libraryName is 'special', then template 'hello' will be available under name 'special/hello'.
tplEngine.insertTemplateLib ( templates, libraryName )
- templates: {}. Keys are template names. Values are templates;
- libraryName: string. Library name.
- Method return options:
- tplEngine;
- Method is chainable;
Example:
const templates = {
'hello' : 'Hello {{user}}' // template 'hello'
, 'bye' : 'Good bye {{user}}' // template 'bye'
}
tplEngine.insertTemplateLib ( templates, 'special' )
// templates are available as 'special/hello' and 'special/bye'