How to use the @aurelia/runtime-html.DOM.createTextNode function in @aurelia/runtime-html

To help you get started, we’ve selected a few @aurelia/runtime-html examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / aurelia / packages / testing / src / h.ts View on Github external
: (`${value}`).split(' ');
      el.classList.add(...value.filter(Boolean));
    } else if (attr in el || attr === 'data' || attr.startsWith('_')) {
      (el as any)[attr.replace(/^_/, '')] = attrs[attr];
    } else {
      el.setAttribute(attr, attrs[attr] as string);
    }
  }
  const childrenCt = el.tagName === 'TEMPLATE' ? (el as HTMLTemplateElement).content : el;
  for (const child of children) {
    if (child === null || child === undefined) {
      continue;
    }
    childrenCt.appendChild(isNodeOrTextOrComment(child)
      ? child
      : DOM.createTextNode(`${child}`)
    );
  }
  return el as any;
}
github aurelia / aurelia / packages / testing / dist / esnext / h.js View on Github external
}
        else if (attr in el || attr === 'data' || attr.startsWith('_')) {
            el[attr.replace(/^_/, '')] = attrs[attr];
        }
        else {
            el.setAttribute(attr, attrs[attr]);
        }
    }
    const childrenCt = el.tagName === 'TEMPLATE' ? el.content : el;
    for (const child of children) {
        if (child === null || child === undefined) {
            continue;
        }
        childrenCt.appendChild(isNodeOrTextOrComment(child)
            ? child
            : DOM.createTextNode(`${child}`));
    }
    return el;
}
function isNodeOrTextOrComment(obj) {