lib/boilerplate.view.js
function declareRootElement( def, code ) {
    const rootElementName = buildElement( def, code );

    code.section.elements.define.push( "//-----------------------" );
    code.section.elements.define.push( "// Declare root element." );
    code.section.elements.define.push(
        "Object.defineProperty( this, '$', {",
        [
            `value: ${rootElementName}.$,`,
            "writable: false, ",
            "enumerable: false, ",
            "configurable: false"
        ],
        "});"
    );
}
function declareRootElement( def, code ) {
    const rootElementName = buildElement( def, code );

    code.section.elements.define.push( "//-----------------------" );
    code.section.elements.define.push( "// Declare root element." );
    code.section.elements.define.push(
        "Object.defineProperty( this, '$', {",
        [
            `value: ${rootElementName}.$,`,
            "writable: false, ",
            "enumerable: false, ",
            "configurable: false"
        ],
        "});"
    );
}
function declareRootElement ( def , code ) { const rootElementName = buildElement ( def , code ) ; code . section . elements . define . push ( "//-----------------------" ) ; code . section . elements . define . push ( "// Declare root element." ) ; code . section . elements . define . push ( "Object.defineProperty( this, '$', {" , [ ` ${ rootElementName } ` , "writable: false, " , "enumerable: false, " , "configurable: false" ] , "});" ) ; }
Javascript for for root variable declaration.

@param  {object} def - `{View ...}`
@param  {Template} code - Helper to write the Javascript code.

@return {undefined}
Javascript for for root variable declaration .