templateEngine
client
This is for the module returned by require('socketstream').client.templateEngine
.
Generate output (as a string) from Template Engines
function(out) {
if (typeof out === 'string') {
} else {
// error object
}
}
Param | Type | Details |
---|---|---|
bundler | Object |
|
files | Array |
|
cb | Function |
|
Use a template engine for the 'dirs' indicated (will use it on all '/' dirs within /client/templates by default)
To make templates in /client/ember-view
available in Ember.
ss.client.templateEngine.use('ember','./ember-view');
To make templates in /client/angular-view
available in Angular.
ss.client.templateEngine.use('angular','./angular-view');
To make templates in /client/templates/angular-view
available in Angular.
ss.client.templateEngine.use('angular','/angular-view');
To make templates anywhere in /client
available in Angular.
ss.client.templateEngine.use('angular','/');
To make templates anywhere in /client
available using a custom engine.
ss.client.templateEngine.use(require('custom-engine'));
To make templates anywhere in /client/custom
available using a custom engine.
ss.client.templateEngine.use(require('custom-engine'),'./custom');
Param | Type | Details |
---|---|---|
name | stringFunction |
|
dirs | Array |
|
config | Object |
|