lib/boilerplate.view.js
function buildViewAttribsInit( attName, attValue, code ) {
    try {
        if ( typeof attValue === "undefined" ) {
            // code.section.attribs.init.push(`this.${attName} = args[${JSON.stringify(attName)}];`);
            code.section.attribs.init
                .push( `pm.set("${attName}", args[${JSON.stringify(attName)}]);` );
        } else {
            code.functions.defVal = "(args, attName, attValue) " +
                "{ return args[attName] === undefined ? attValue : args[attName]; }";
            // code.section.attribs.init.push( "this." + attName + " = defVal(args, " +
            //    JSON.stringify( attName ) + ", " + JSON.stringify( attValue ) +
            //    ");" );
            code.section.attribs.init
                .push( `pm.set("${attName}", defVal(args, "${attName}", ${JSON.stringify( attValue )}));` );
        }
    } catch ( ex ) {
        bubble(
            ex,
            `buildViewAttribsInit(${attName}, ${JSON.stringify(attValue)})`
        );
    }
}
function buildViewAttribsInit( attName, attValue, code ) {
    try {
        if ( typeof attValue === "undefined" ) {
            // code.section.attribs.init.push(`this.${attName} = args[${JSON.stringify(attName)}];`);
            code.section.attribs.init
                .push( `pm.set("${attName}", args[${JSON.stringify(attName)}]);` );
        } else {
            code.functions.defVal = "(args, attName, attValue) " +
                "{ return args[attName] === undefined ? attValue : args[attName]; }";
            // code.section.attribs.init.push( "this." + attName + " = defVal(args, " +
            //    JSON.stringify( attName ) + ", " + JSON.stringify( attValue ) +
            //    ");" );
            code.section.attribs.init
                .push( `pm.set("${attName}", defVal(args, "${attName}", ${JSON.stringify( attValue )}));` );
        }
    } catch ( ex ) {
        bubble(
            ex,
            `buildViewAttribsInit(${attName}, ${JSON.stringify(attValue)})`
        );
    }
}
function buildViewAttribsInit ( attName , attValue , code ) { try { if ( typeof attValue === "undefined" ) { // code.section.attribs.init.push(`this.${attName} = args[${JSON.stringify(attName)}];`); code . section . attribs . init . push ( ` ${ attName } ${ JSON . stringify ( attName ) } ` ) ; } else { code . functions . defVal = "(args, attName, attValue) " + "{ return args[attName] === undefined ? attValue : args[attName]; }" ; // code.section.attribs.init.push( "this." + attName + " = defVal(args, " + //    JSON.stringify( attName ) + ", " + JSON.stringify( attValue ) + //    ");" ); code . section . attribs . init . push ( ` ${ attName } ${ attName } ${ JSON . stringify ( attValue ) } ` ) ; } } catch ( ex ) { bubble ( ex , ` ${ attName } ${ JSON . stringify ( attValue ) } ` ) ; } }
Initialize attribute with a value. Priority to the value set in the
contructor args.
Initialize attribute with a value . Priority to the value set in the contructor args .