Skip to content

A collection of helper functions to simplify the use of Communibase data in Templates.

License

Notifications You must be signed in to change notification settings

kingsquare/communibase-template-data-factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

A collection of helper functions to simplify the use of Communibase data in Templates.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •