How to use the @aurelia/jit.CustomAttributeSymbol 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
bindCustomAttribute(attrSyntax, attrInfo) {
        if (Tracer.enabled) {
            Tracer.enter('TemplateBinder', 'bindCustomAttribute', slice.call(arguments));
        }
        const command = this.resources.getBindingCommand(attrSyntax);
        let symbol;
        if (command == null && attrInfo.hasDynamicOptions) {
            // a dynamicOptions (semicolon separated binding) is only valid without a binding command;
            // the binding commands must be declared in the dynamicOptions expression itself
            symbol = new CustomAttributeSymbol(attrSyntax, attrInfo);
            this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
        }
        else {
            // we've either got a command (with or without dynamicOptions, the latter maps to the first bindable),
            // or a null command but without dynamicOptions (which may be an interpolation or a normal string)
            symbol = new CustomAttributeSymbol(attrSyntax, attrInfo);
            const bindingType = command == null ? 2048 /* Interpolation */ : command.bindingType;
            const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
            symbol.bindings.push(new BindingSymbol(command, attrInfo.bindable, expr, attrSyntax.rawValue, attrSyntax.target));
        }
        this.manifest.attributes.push(symbol);
        this.manifest.isTarget = true;
        if (Tracer.enabled) {
            Tracer.leave();
        }
    }
github aurelia / aurelia / packages / jit-html / src / template-binder.ts View on Github external
private bindCustomAttribute(attrSyntax: AttrSyntax, attrInfo: AttrInfo): void {

    const command = this.resources.getBindingCommand(attrSyntax, false);
    let symbol: CustomAttributeSymbol;
    if (command == null && attrInfo.hasDynamicOptions) {
      // a dynamicOptions (semicolon separated binding) is only valid without a binding command;
      // the binding commands must be declared in the dynamicOptions expression itself
      symbol = new CustomAttributeSymbol(attrSyntax, attrInfo);
      this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
    } else {
      // we've either got a command (with or without dynamicOptions, the latter maps to the first bindable),
      // or a null command but without dynamicOptions (which may be an interpolation or a normal string)
      symbol = new CustomAttributeSymbol(attrSyntax, attrInfo);
      const bindingType = command == null ? BindingType.Interpolation : command.bindingType;
      const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
      symbol.bindings.push(new BindingSymbol(command, attrInfo.bindable, expr, attrSyntax.rawValue, attrSyntax.target));
    }
    const manifest = this.manifest!;
    manifest.customAttributes.push(symbol);
    manifest.isTarget = true;

  }
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
bindCustomAttribute(attrSyntax, attrInfo) {
        if (Tracer.enabled) {
            Tracer.enter('TemplateBinder', 'bindCustomAttribute', slice.call(arguments));
        }
        const command = this.resources.getBindingCommand(attrSyntax);
        let symbol;
        if (command == null && attrInfo.hasDynamicOptions) {
            // a dynamicOptions (semicolon separated binding) is only valid without a binding command;
            // the binding commands must be declared in the dynamicOptions expression itself
            symbol = new CustomAttributeSymbol(attrSyntax, attrInfo);
            this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
        }
        else {
            // we've either got a command (with or without dynamicOptions, the latter maps to the first bindable),
            // or a null command but without dynamicOptions (which may be an interpolation or a normal string)
            symbol = new CustomAttributeSymbol(attrSyntax, attrInfo);
            const bindingType = command == null ? 2048 /* Interpolation */ : command.bindingType;
            const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
            symbol.bindings.push(new BindingSymbol(command, attrInfo.bindable, expr, attrSyntax.rawValue, attrSyntax.target));
        }
        this.manifest.attributes.push(symbol);
        this.manifest.isTarget = true;
        if (Tracer.enabled) {
            Tracer.leave();
        }
    }
    bindMultiAttribute(symbol, attrInfo, value) {
github aurelia / aurelia / packages / jit-html / src / template-binder.ts View on Github external
private bindCustomAttribute(attrSyntax: AttrSyntax, attrInfo: AttrInfo): void {

    const command = this.resources.getBindingCommand(attrSyntax, false);
    let symbol: CustomAttributeSymbol;
    if (command == null && attrInfo.hasDynamicOptions) {
      // a dynamicOptions (semicolon separated binding) is only valid without a binding command;
      // the binding commands must be declared in the dynamicOptions expression itself
      symbol = new CustomAttributeSymbol(attrSyntax, attrInfo);
      this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
    } else {
      // we've either got a command (with or without dynamicOptions, the latter maps to the first bindable),
      // or a null command but without dynamicOptions (which may be an interpolation or a normal string)
      symbol = new CustomAttributeSymbol(attrSyntax, attrInfo);
      const bindingType = command == null ? BindingType.Interpolation : command.bindingType;
      const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
      symbol.bindings.push(new BindingSymbol(command, attrInfo.bindable, expr, attrSyntax.rawValue, attrSyntax.target));
    }
    const manifest = this.manifest!;
    manifest.customAttributes.push(symbol);
    manifest.isTarget = true;

  }