How to use the @aurelia/jit.parseExpression 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 / testing / dist / umd / au-dom.js View on Github external
createRepeatInstruction(expression, def) {
            return new runtime_1.HydrateTemplateController(def, 'repeat', [new runtime_1.IteratorBindingInstruction(jit_1.parseExpression(expression, 539 /* ForCommand */), 'items')]);
        },
        createReplaceableInstruction(def) {
github aurelia / aurelia / packages / testing / src / au-dom.ts View on Github external
createTextDefinition(expression: string, name: string = `${expression}-text`): ITemplateDefinition {
    return {
      build: { required: false },
      name,
      template: AuNode.createText().makeTarget(),
      // @ts-ignore
      instructions: [[new AuTextInstruction(parseExpression(expression))]]
    };
  },
  createTemplateControllerDefinition(instruction: HydrateTemplateController, name: string = instruction.res): ITemplateDefinition {
github aurelia / aurelia / packages / __tests__ / jit / expression-parser.spec.ts View on Github external
it(char, function () {
        const identifier = `$${char}`;
        assert.deepStrictEqual(parseExpression(identifier), new AccessScopeExpression(identifier, 0));
      });
    }
github aurelia / aurelia / packages / __tests__ / 2-runtime / controller.spec.ts View on Github external
} = setup();

      const flags = LF.none;

      const ViewModel = createViewModel(
        h(
          'div',
          null,
          h('au-m', { class: 'au' }),
          '',
          h('au-m', { class: 'au' }),
        ),
        [],
        [
          [
            new TextBindingInstruction(parseExpression(`\${id&oneTime}`, BindingType.Interpolation)),
          ],
          [
            new HydrateTemplateController(
              createDescription(
                'if',
                h('view-model', { class: 'au' }),
                [],
                [
                  [new HydrateElementInstruction('view-model', [])],
                ],
                noHooks,
              ),
              'if',
              [new ToViewBindingInstruction(parseExpression('id===1&oneTime'), 'value')],
            ),
          ],
github aurelia / aurelia / packages / testing / dist / esnext / au-dom.js View on Github external
        return new HydrateElementInstruction(name, bindings.map(([from, to]) => new ToViewBindingInstruction(parseExpression(from), to)), parts);
    },
github aurelia / aurelia / packages / testing / dist / umd / au-dom.js View on Github external
createIfInstruction(expression, def) {
            return new runtime_1.HydrateTemplateController(def, 'if', [new runtime_1.ToViewBindingInstruction(jit_1.parseExpression(expression), 'value')]);
        },
        createElseInstruction(def) {
github aurelia / aurelia / packages / testing / src / au-dom.ts View on Github external
      bindings.map(([from, to]) => new LetBindingInstruction(parseExpression(from), to)),
      toViewModel
github aurelia / aurelia / packages / testing / src / au-dom.ts View on Github external
createWithInstruction(expression: string, def: PartialCustomElementDefinition): HydrateTemplateController {
    return new HydrateTemplateController(
      def,
      'with',
      [new ToViewBindingInstruction(parseExpression(expression), 'value')]
    );
  },
  createElementInstruction(name: string, bindings: [string, string][], parts?: Record): HydrateElementInstruction {
github aurelia / aurelia / packages / testing / src / au-dom.ts View on Github external
      bindings.map(([from, to]) => new ToViewBindingInstruction(parseExpression(from), to)),
      parts
github aurelia / aurelia / packages / testing / src / au-dom.ts View on Github external
      bindings.map(([from, to]) => new LetBindingInstruction(parseExpression(from), to)),
      toBindingContext