index.js
/**
 * Helper function for initial configuration of the Template instance.
 *
 * @param  {Object} `config` Configuration object for setting up the `template` object.
 * @api private
 */
Helper function for initial configuration of the Template instance.
@param  {Object} `config` Configuration object for setting up the `template` object.
@api private
Helper function for initial configuration of the Template instance . @param { Object } ` config ` Configuration object for setting up the ` template ` object . @api private
function initTemplate (config) {
  if (!View.template) {
    throw new Error('Error creating a new View. Missing template.');
  }
  if (!View.template.getEngine('.hbs')) {
    View.template.engine('hbs', engineHandlebars);
  }
  var root = config.root || path.join(__dirname, '../views');
  var data = config.data || false;
  var layouts = config.layouts || path.join(root, 'layouts/*.hbs');
  var partials = config.partials || path.join(root, '{partials,includes}/*.hbs');
  if (data) View.template.data(data);
  View.template.partials(partials);
  View.template.layouts(layouts);
}
function initTemplate ( config ) { if ( ! View . template ) { throw new Error ( 'Error creating a new View. Missing template.' ) ; } if ( ! View . template . getEngine ( '.hbs' ) ) { View . template . engine ( 'hbs' , engineHandlebars ) ; } var root = config . root || path . join ( __dirname , '../views' ) ; var data = config . data || false ; var layouts = config . layouts || path . join ( root , 'layouts/*.hbs' ) ; var partials = config . partials || path . join ( root , '{partials,includes}/*.hbs' ) ; if ( data ) View . template . data ( data ) ; View . template . partials ( partials ) ; View . template . layouts ( layouts ) ; }
Helper function for initial configuration of the Template instance.
Helper function for initial configuration of the Template instance .