src/page.js
function makeDom(cfg, response) {
    // apply defaults
    _.defaults(cfg, defaults);
    // create Document
    let doc = Parser.dom(cfg.template, (_.isPlainObject(cfg.data) ? cfg.data: cfg.data(response)));
    // prepare the Document
    prepareDom(doc, cfg);
    // call the after ready method if defined in the configuration
    if (_.isFunction(cfg.afterReady)) {
        console.log('calling afterReady method...');
        cfg.afterReady(doc);
    }
    // cache cfg at the document level
    doc.page = cfg;

    return doc;
}
function makeDom(cfg, response) {
    // apply defaults
    _.defaults(cfg, defaults);
    // create Document
    let doc = Parser.dom(cfg.template, (_.isPlainObject(cfg.data) ? cfg.data: cfg.data(response)));
    // prepare the Document
    prepareDom(doc, cfg);
    // call the after ready method if defined in the configuration
    if (_.isFunction(cfg.afterReady)) {
        console.log('calling afterReady method...');
        cfg.afterReady(doc);
    }
    // cache cfg at the document level
    doc.page = cfg;

    return doc;
}
function makeDom ( cfg , response ) { // apply defaults _ . defaults ( cfg , defaults ) ; // create Document let doc = Parser . dom ( cfg . template , ( _ . isPlainObject ( cfg . data ) ? cfg . data : cfg . data ( response ) ) ) ; // prepare the Document prepareDom ( doc , cfg ) ; // call the after ready method if defined in the configuration if ( _ . isFunction ( cfg . afterReady ) ) { console . log ( 'calling afterReady method...' ) ; cfg . afterReady ( doc ) ; } // cache cfg at the document level doc . page = cfg ; return doc ; }
A helper method that calls the data method to transform the data.
It then creates a dom from the provided template and the final data.

@inner
@alias module:page.makeDom

@param  {Object} cfg             Page configuration options
@param  {Object} response        The data object
@return {Document}               The newly created document
A helper method that calls the data method to transform the data . It then creates a dom from the provided template and the final data .