Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

No way to declare Input transform and static ngAcceptInputType_ at the same time #51190

Copy link
Copy link
@JounQin

Description

@JounQin
Issue body actions

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

When using Input transform feature, the input's type become unknown, and I'd like to allow certain type only like boolean | ''

import { booleanAttribute, Component, Input } from '@angular/core';

@Component({
  selector: 'app-test',
  template: `Disabled {{ disabled | json }}`,
})
export class TestComponent {
  @Input({ transform: booleanAttribute })
  disabled?: boolean;

  static ngAcceptInputType_disabled: boolean | '';
}

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-zji3lf

Please provide the exception or error you saw

Class cannot have both a transform function on Input disabled and a static member called ngAcceptInputType_disabled

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.