How to use the @aurelia/runtime-html.SetAttributeInstruction 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 / jit-html / src / template-compiler.ts View on Github external
private compilePlainAttribute(symbol: PlainAttributeSymbol): HTMLAttributeInstruction {
    if (symbol.command == null) {
      if (symbol.expression == null) {
        // a plain attribute on a surrogate
        return new SetAttributeInstruction(symbol.syntax.rawValue, symbol.syntax.target);
      } else {
        // a plain attribute with an interpolation
        return new InterpolationInstruction(symbol.expression as IInterpolationExpression, symbol.syntax.target);
      }
    } else {
      // a plain attribute with a binding command
      return symbol.command.compile(symbol) as HTMLAttributeInstruction;
    }
  }
github aurelia / aurelia / packages / jit-html / src / template-compiler.ts View on Github external
private compilePlainAttribute(symbol: PlainAttributeSymbol): HTMLAttributeInstruction {
    if (symbol.command == null) {
      if (symbol.expression == null) {
        // a plain attribute on a surrogate
        return new SetAttributeInstruction(symbol.syntax.rawValue, symbol.syntax.target);
      } else {
        // a plain attribute with an interpolation
        return new InterpolationInstruction(symbol.expression as IInterpolationExpression, symbol.syntax.target);
      }
    } else {
      // a plain attribute with a binding command
      return symbol.command.compile(symbol) as HTMLAttributeInstruction;
    }
  }
github aurelia / aurelia / packages / jit-html / dist / index.es6.js View on Github external
compilePlainAttribute(symbol) {
        if (symbol.command == null) {
            if (symbol.expression == null) {
                // a plain attribute on a surrogate
                return new SetAttributeInstruction(symbol.syntax.rawValue, symbol.syntax.target);
            }
            else {
                // a plain attribute with an interpolation
                return new InterpolationInstruction(symbol.expression, symbol.syntax.target);
            }
        }
        else {
            // a plain attribute with a binding command
            return symbol.command.compile(symbol);
        }
    }
    compileAttribute(symbol) {
github aurelia / aurelia / packages / jit-html / dist / esnext / template-compiler.js View on Github external
if (symbol.command === null) {
            const syntax = symbol.syntax;
            if (symbol.expression === null) {
                const attrRawValue = syntax.rawValue;
                if (isOnSurrogate) {
                    switch (syntax.target) {
                        case 'class':
                            return new SetClassAttributeInstruction(attrRawValue);
                        case 'style':
                            return new SetStyleAttributeInstruction(attrRawValue);
                        // todo:  define how to merge other attribute peacefully
                        //        this is an existing feature request
                    }
                }
                // a plain attribute on a surrogate
                return new SetAttributeInstruction(attrRawValue, syntax.target);
            }
            else {
                // a plain attribute with an interpolation
                return new InterpolationInstruction(symbol.expression, syntax.target);
            }
        }
        else {
            // a plain attribute with a binding command
            return symbol.command.compile(symbol);
        }
    }
    // private compileAttribute(symbol: IAttributeSymbol): HTMLAttributeInstruction {
github aurelia / aurelia / packages / jit-html / dist / umd / template-compiler.js View on Github external
if (symbol.command === null) {
                const syntax = symbol.syntax;
                if (symbol.expression === null) {
                    const attrRawValue = syntax.rawValue;
                    if (isOnSurrogate) {
                        switch (syntax.target) {
                            case 'class':
                                return new runtime_html_1.SetClassAttributeInstruction(attrRawValue);
                            case 'style':
                                return new runtime_html_1.SetStyleAttributeInstruction(attrRawValue);
                            // todo:  define how to merge other attribute peacefully
                            //        this is an existing feature request
                        }
                    }
                    // a plain attribute on a surrogate
                    return new runtime_html_1.SetAttributeInstruction(attrRawValue, syntax.target);
                }
                else {
                    // a plain attribute with an interpolation
                    return new runtime_1.InterpolationInstruction(symbol.expression, syntax.target);
                }
            }
            else {
                // a plain attribute with a binding command
                return symbol.command.compile(symbol);
            }
        }
        // private compileAttribute(symbol: IAttributeSymbol): HTMLAttributeInstruction {