How to use the @aurelia/jit.TemplateControllerSymbol 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
private declareTemplateController(attrSyntax: AttrSyntax, attrInfo: AttrInfo): TemplateControllerSymbol {

    let symbol: TemplateControllerSymbol;
    // dynamicOptions logic here is similar to (and explained in) bindCustomAttribute
    const command = this.resources.getBindingCommand(attrSyntax, false);
    if (command == null && attrInfo.hasDynamicOptions) {
      symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
      this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
    } else {
      symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
      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));
    }

    return symbol;
  }
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
declareTemplateController(attrSyntax, attrInfo) {
        if (Tracer.enabled) {
            Tracer.enter('TemplateBinder', 'declareTemplateController', slice.call(arguments));
        }
        let symbol;
        // dynamicOptions logic here is similar to (and explained in) bindCustomAttribute
        const command = this.resources.getBindingCommand(attrSyntax);
        if (command == null && attrInfo.hasDynamicOptions) {
            symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
            this.partName = null;
            this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
        }
        else {
            symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
            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.partName = null;
        }
        if (Tracer.enabled) {
            Tracer.leave();
        }
        return symbol;
    }
    bindCustomAttribute(attrSyntax, attrInfo) {
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
declareTemplateController(attrSyntax, attrInfo) {
        if (Tracer.enabled) {
            Tracer.enter('TemplateBinder', 'declareTemplateController', slice.call(arguments));
        }
        let symbol;
        // dynamicOptions logic here is similar to (and explained in) bindCustomAttribute
        const command = this.resources.getBindingCommand(attrSyntax);
        if (command == null && attrInfo.hasDynamicOptions) {
            symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
            this.partName = null;
            this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
        }
        else {
            symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
            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.partName = null;
        }
        if (Tracer.enabled) {
            Tracer.leave();
        }
        return symbol;
    }
    bindCustomAttribute(attrSyntax, attrInfo) {
github aurelia / aurelia / packages / jit-html / src / template-binder.ts View on Github external
private declareTemplateController(attrSyntax: AttrSyntax, attrInfo: AttrInfo): TemplateControllerSymbol {

    let symbol: TemplateControllerSymbol;
    // dynamicOptions logic here is similar to (and explained in) bindCustomAttribute
    const command = this.resources.getBindingCommand(attrSyntax, false);
    if (command == null && attrInfo.hasDynamicOptions) {
      symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
      this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
    } else {
      symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
      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));
    }

    return symbol;
  }