lib/boilerplate.view.js
function outputClassBody( code ) {
    try {
        let out = '';
        if ( code.that ) out += "        const that = this;\n";
        if ( code.pm ) out += "        const pm = PM(this);\n";
        out += generate( code.section.attribs.define, "Create attributes", "        " );
        out += generate( code.section.elements.define, "Create elements", "        " );
        out += generate( code.section.events, "Events", "        " );
        out += arrayToCodeWithNewLine( code.generateLinks(), "        " );
        out += generate( code.section.ons, "On attribute changed", "        " );
        out += generate( code.section.elements.init, "Initialize elements", "        " );
        out += generate( code.section.attribs.init, "Initialize attributes", "        " );
        if ( code.section.init ) {
            out += "        // Initialization.\n";
            out += `        CODE_BEHIND.${code.section.init}.call( this );\n`;
        }
        out += "        $.addClass(this, 'view', 'custom');\n";
        return out;
    } catch ( ex ) {
        bubble( ex, "outputClassBody" );
        return null;
    }
}
function outputClassBody( code ) {
    try {
        let out = '';
        if ( code.that ) out += "        const that = this;\n";
        if ( code.pm ) out += "        const pm = PM(this);\n";
        out += generate( code.section.attribs.define, "Create attributes", "        " );
        out += generate( code.section.elements.define, "Create elements", "        " );
        out += generate( code.section.events, "Events", "        " );
        out += arrayToCodeWithNewLine( code.generateLinks(), "        " );
        out += generate( code.section.ons, "On attribute changed", "        " );
        out += generate( code.section.elements.init, "Initialize elements", "        " );
        out += generate( code.section.attribs.init, "Initialize attributes", "        " );
        if ( code.section.init ) {
            out += "        // Initialization.\n";
            out += `        CODE_BEHIND.${code.section.init}.call( this );\n`;
        }
        out += "        $.addClass(this, 'view', 'custom');\n";
        return out;
    } catch ( ex ) {
        bubble( ex, "outputClassBody" );
        return null;
    }
}
function outputClassBody ( code ) { try { let out = '' ; if ( code . that ) out += "        const that = this;\n" ; if ( code . pm ) out += "        const pm = PM(this);\n" ; out += generate ( code . section . attribs . define , "Create attributes" , "        " ) ; out += generate ( code . section . elements . define , "Create elements" , "        " ) ; out += generate ( code . section . events , "Events" , "        " ) ; out += arrayToCodeWithNewLine ( code . generateLinks ( ) , "        " ) ; out += generate ( code . section . ons , "On attribute changed" , "        " ) ; out += generate ( code . section . elements . init , "Initialize elements" , "        " ) ; out += generate ( code . section . attribs . init , "Initialize attributes" , "        " ) ; if ( code . section . init ) { out += "        // Initialization.\n" ; out += ` ${ code . section . init } \n ` ; } out += "        $.addClass(this, 'view', 'custom');\n" ; return out ; } catch ( ex ) { bubble ( ex , "outputClassBody" ) ; return null ; } }
Class body.

@param  {object} code - Helper for Javascript code writing.

@return {string} Resulting JS code.
Class body .