.removeTemplate - PeterNaydenov/code-assembly-line GitHub Wiki
Remove template/templates
tplEngine.removeTemplate ( tplName )
- tplName: string | string[]. Templates names for remove;
- Method return options:
- tplEngine;
- Method is chainable;
Example:
const templates = {
'hello' : 'Hello {{user}}' // template 'hello'
, 'bye' : 'Good bye {{user}}' // template 'bye'
, 'tnx' : 'Special thanks to {{user}}' // template 'tnx'
}
tplEngine.insertTemplate ( templates )
// -> three templates were added to tplEngine: 'hello', 'bye', 'tnx'.
tplEngine.removeTemplate ( [ 'tnx', 'bye'] )
// -> will remove templates 'bye' and 'tnx'. Only 'hello' will stay.
/*
Alternative way without array:
tplEngine.removeTemplate ( 'tnx', 'bye' )
*/