code: function (attr, expr, context, data) {
                  var val = this.exprEvaluator(expr, context, data);
                  if (val || typeof val === 'string' || typeof val === 'number') {
                      return " " + attr + '=' + this.generateAttribute(val + '');
                  } else {
                      //else if undefined, null, false then don't render attribute.
                      return '';
                  }
              }
docs: Assuming attr parameter is html encoded.