How to use the @aurelia/jit.CustomElementSymbol function in @aurelia/jit

To help you get started, we’ve selected a few @aurelia/jit 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 / jit-html / src / template-binder.ts View on Github external
let manifestRoot: CustomElementSymbol = (void 0)!;
    let name = node.getAttribute('as-element');
    if (name == null) {
      name = node.nodeName.toLowerCase();
    }
    const elementInfo = this.resources.getElementInfo(name);
    if (elementInfo == null) {
      // there is no registered custom element with this name
      // @ts-ignore
      this.manifest = new PlainElementSymbol(node);
    } else {
      // it's a custom element so we set the manifestRoot as well (for storing replace-parts)
      this.parentManifestRoot = this.manifestRoot;
      // @ts-ignore
      manifestRoot = this.manifestRoot = this.manifest = new CustomElementSymbol(this.dom, node, elementInfo);
    }

    // lifting operations done by template controllers and replace-parts effectively unlink the nodes, so start at the bottom
    this.bindChildNodes(node);

    // the parentManifest will receive either the direct child nodes, or the template controllers / replace-parts
    // wrapping them
    this.bindAttributes(node, parentManifest);

    if (manifestRoot != null && manifestRoot.isContainerless) {
      node.parentNode!.replaceChild(manifestRoot.marker as Node, node);
    } else if (this.manifest!.isTarget) {
      node.classList.add('au');
    }

    // restore the stored manifests so the attributes are processed on the correct lavel
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
let manifestRoot = (void 0);
        let name = node.getAttribute('as-element');
        if (name == null) {
            name = node.nodeName.toLowerCase();
        }
        const elementInfo = this.resources.getElementInfo(name);
        if (elementInfo == null) {
            // there is no registered custom element with this name
            // @ts-ignore
            this.manifest = new PlainElementSymbol(node);
        }
        else {
            // it's a custom element so we set the manifestRoot as well (for storing replace-parts)
            this.parentManifestRoot = this.manifestRoot;
            // @ts-ignore
            manifestRoot = this.manifestRoot = this.manifest = new CustomElementSymbol(this.dom, node, elementInfo);
        }
        // lifting operations done by template controllers and replace-parts effectively unlink the nodes, so start at the bottom
        this.bindChildNodes(node);
        // the parentManifest will receive either the direct child nodes, or the template controllers / replace-parts
        // wrapping them
        this.bindAttributes(node, parentManifest);
        if (manifestRoot != null && manifestRoot.isContainerless) {
            node.parentNode.replaceChild(manifestRoot.marker, node);
        }
        else if (this.manifest.isTarget) {
            node.classList.add('au');
        }
        // restore the stored manifests so the attributes are processed on the correct lavel
        this.parentManifestRoot = parentManifestRootSave;
        this.manifestRoot = manifestRootSave;
        this.manifest = manifestSave;