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

[Bug]: Angular signal inputs that are aliased don't work properly #29697

Open
Ruudt opened this issue Nov 24, 2024 · 3 comments
Open

[Bug]: Angular signal inputs that are aliased don't work properly #29697

Ruudt opened this issue Nov 24, 2024 · 3 comments

Comments

@Ruudt
Copy link

Ruudt commented Nov 24, 2024

Describe the bug

Angular allows to alias inputs, for example when kebab-case attribute names are desired (see here). When I do so and assign such attribute a value in the args list then it seems the signal isn't getting the correct value (InputSignal<string>) but the value itself directly.

Related to #25784 and PR #26413

Reproduction link

https://stackblitz.com/edit/github-gh38gu

Reproduction steps

  1. Go to above link
  2. Navigate to the story Example\Button\Works
  3. Open Devtools' console which will not show errors about backgroundColor (which is aliased)
  4. Navigate to the story Example\Button\Broken
  5. In Devtools' console there will be error messages about backgroundColor only. The attribute foregroundColor is not mentioned and the only difference is it not being aliased in the component.
ERROR TypeError: ctx.backgroundColor is not a function
    at ButtonComponent_Template (template.html:6:3)

The broken story defines both attribute in the args, that seems to "activate" the difference.

System

Storybook Environment Info:

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm <----- active
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @storybook/addon-docs: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/addon-essentials: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/addon-interactions: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/addon-onboarding: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/angular: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/blocks: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/test: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    storybook: ^8.5.0-alpha.10 => 8.5.0-alpha.10

Additional context

No response

@valentinpalkovic
Copy link
Contributor

@storybookjs/angular Do any of you want to work on this issue?

@balaajimuthukumar
Copy link

@valentinpalkovic I would like to take up this issue and work on it.

@szykov
Copy link

szykov commented Dec 27, 2024

Same here! A quick fix that worked for me was using a custom render and using the values directly into the template.

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

No branches or pull requests

4 participants