.insertDataLib - PeterNaydenov/code-assembly-line GitHub Wiki

Insert data in a separate namespace. If libraryName is 'special', then data 'hello' will be available under name 'special/hello'.

tplEngine.insertDataLib ( data, libraryName )

  • data: {}. Keys are template names. Values are templates;
  • libraryName: string. Library name.
  • Method return options:
    • tplEngine;
  • Method is chainable;

Example:

  const data = {
                        'hello' : 'Hello}'   // data 'hello'
                      , 'bye'   : 'Good bye' // data 'bye'
                    }

 tplEngine.insertDataLib ( templates, 'special' )
 // data records are available as 'special/hello' and 'special/bye'

Note: Data, templates and processes are different objects inside 'Code-Assemblty-Line'. So you can have data and template with same name. Template 'special/hello' is different from 'special/hello' data record.