Skip to content

Named templates within a class-based component don't have this #249

@rykov

Description

@rykov

Having the following component:

import Component from '@glimmer/component';

export default class Hello extends Component {
  value = "HELLO";

  <template>
    From top template: {{ this.value }}<br/>
    <this.Subtemplate/><br/>
  </template>

  Subtemplate = <template>
    From subtemplate: {{ this.value }}
  </template>
}

I get the following output:

From top template: HELLO
From subtemplate:

It seems intuitive that all templates defined within a Component would expose this to access the instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions