How to use the @aurelia/jit.PlainAttributeSymbol 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 / dist / index.es6.js View on Github external
}
            else if (expr != null || attrSyntax.target === 'ref') {
                // if it does not map to a bindable, only add it if we were able to parse an expression (either a command or interpolation)
                manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
                manifest.isTarget = true;
            }
        }
        else if (expr != null || attrSyntax.target === 'ref') {
            // either a binding command, an interpolation, or a ref
            manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
            manifest.isTarget = true;
        }
        else if (manifest === this.surrogate) {
            // any attributes, even if they are plain (no command/interpolation etc), should be added if they
            // are on the surrogate element
            manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
        }
        if (command == null && expr != null) {
            // if it's an interpolation, clear the attribute value
            attr.value = '';
        }
        if (Tracer.enabled) {
            Tracer.leave();
        }
    }
    declareReplacePart(node) {
github aurelia / aurelia / packages / jit-html / src / template-binder.ts View on Github external
// the template compiler will translate it to the correct instruction
        (manifest as CustomElementSymbol).bindings.push(new BindingSymbol(command, bindable, expr, attrRawValue, attrTarget));
        manifest.isTarget = true;
      } else if (expr != null) {
        // if it does not map to a bindable, only add it if we were able to parse an expression (either a command or interpolation)
        manifest.plainAttributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
        manifest.isTarget = true;
      }
    } else if (expr != null) {
      // either a binding command, an interpolation, or a ref
      manifest.plainAttributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
      manifest.isTarget = true;
    } else if (manifest === this.surrogate) {
      // any attributes, even if they are plain (no command/interpolation etc), should be added if they
      // are on the surrogate element
      manifest.plainAttributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
    }

    if (command == null && expr != null) {
      // if it's an interpolation, clear the attribute value
      attr.value = '';
    }

  }
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
}
        const command = this.resources.getBindingCommand(attrSyntax);
        const bindingType = command == null ? 2048 /* Interpolation */ : command.bindingType;
        const manifest = this.manifest;
        const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
        if (manifest.flags & 16 /* isCustomElement */) {
            const bindable = manifest.bindables[attrSyntax.target];
            if (bindable != null) {
                // if the attribute name matches a bindable property name, add it regardless of whether it's a command, interpolation, or just a plain string;
                // the template compiler will translate it to the correct instruction
                manifest.bindings.push(new BindingSymbol(command, bindable, expr, attrSyntax.rawValue, attrSyntax.target));
                manifest.isTarget = true;
            }
            else if (expr != null || attrSyntax.target === 'ref') {
                // if it does not map to a bindable, only add it if we were able to parse an expression (either a command or interpolation)
                manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
                manifest.isTarget = true;
            }
        }
        else if (expr != null || attrSyntax.target === 'ref') {
            // either a binding command, an interpolation, or a ref
            manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
            manifest.isTarget = true;
        }
        else if (manifest === this.surrogate) {
            // any attributes, even if they are plain (no command/interpolation etc), should be added if they
            // are on the surrogate element
            manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
        }
        if (command == null && expr != null) {
            // if it's an interpolation, clear the attribute value
            attr.value = '';
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
const bindable = manifest.bindables[attrSyntax.target];
            if (bindable != null) {
                // if the attribute name matches a bindable property name, add it regardless of whether it's a command, interpolation, or just a plain string;
                // the template compiler will translate it to the correct instruction
                manifest.bindings.push(new BindingSymbol(command, bindable, expr, attrSyntax.rawValue, attrSyntax.target));
                manifest.isTarget = true;
            }
            else if (expr != null || attrSyntax.target === 'ref') {
                // if it does not map to a bindable, only add it if we were able to parse an expression (either a command or interpolation)
                manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
                manifest.isTarget = true;
            }
        }
        else if (expr != null || attrSyntax.target === 'ref') {
            // either a binding command, an interpolation, or a ref
            manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
            manifest.isTarget = true;
        }
        else if (manifest === this.surrogate) {
            // any attributes, even if they are plain (no command/interpolation etc), should be added if they
            // are on the surrogate element
            manifest.attributes.push(new PlainAttributeSymbol(attrSyntax, command, expr));
        }
        if (command == null && expr != null) {
            // if it's an interpolation, clear the attribute value
            attr.value = '';
        }
        if (Tracer.enabled) {
            Tracer.leave();
        }
    }
    declareReplacePart(node) {