communibase-template-data-factory
v2.0.13
Published
Helper methods for working with Templates and the Communibase service.
Downloads
183
Readme
communibase-template-data-factory
Enrich Communibase-data in any way possible for easy use in dynamic templates.
var Factory = require('communibase-template-data-factory');
// other deps
var factory = new Factory({ ... your options ...});
factory.getPromise("Person", person).then(function () { ... })
Constructor options
All options for the constructor are optional. Possible options:
cbc: an instance of the Communibase Connector. Will be spawned if not supplied stxt: a Javascript-object containing optional translations, e.g.:
{
"Address.countryCode.NL": "Nederland",
"Person.firstName": "Voornaam"
}
Extra serializers
Extra (custom) serializers can be added to the factory using the addSerializers
-method. See serializers in the
entityType
-folder for examples and implementations
Debugging?
See runTest.js line 44, attach a debugger from the IDE to mocha
PLEASE NOTE
This library is compatible with Handlebars 2.0.0
Later versions of Handlebars have a different AST and do not function properly!