Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local-class={{this.size}} throws an error, but local-class="{{this.size}}" is ok #175

Open
gvocale opened this issue Jan 30, 2020 · 1 comment

Comments

@gvocale
Copy link

gvocale commented Jan 30, 2020

In a glimmer component, using ember-css-modules, why the following?

import Component from '@glimmer/component';

enum Size {
  Sm = 'sm',
  Md = 'md',
}

interface Args {
  size: Size;
}

export default class Logo extends Component<Args> {
  size: Size;

  constructor(owner: unknown, args: Args) {
    super(owner, args);
    this.size = this.args.size || Size.Md;
  }
}
{{this.size}} // outputs sm
<div local-class={{this.size}}> // throws error Uncaught (in promise) Error: Compile Error: size 
is not a helper
  <UiIcon @name='logo' />
</div>

In particular, using local-class={{this.size}} throws the error:

Uncaught (in promise) Error: Compile Error: size is not a helper

But instead, using local-class="{{this.size}}" works ok

@gvocale gvocale changed the title Glimmer component and local-class local-class={{this.size}} throws an error, but local-class="{{this.size}}" is ok Jan 30, 2020
@gvocale gvocale changed the title local-class={{this.size}} throws an error, but local-class="{{this.size}}" is ok local-class={{this.size}} throws an error, but local-class="{{this.size}}" is ok Jan 30, 2020
@gvocale gvocale changed the title local-class={{this.size}} throws an error, but local-class="{{this.size}}" is ok local-class={{this.size}} throws an error, but local-class="{{this.size}}" is ok Jan 30, 2020
@lolmaus
Copy link

lolmaus commented May 11, 2020

Duplicate of #132?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants