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

Angular 17.3 input signal not working with customComponents #55739

Closed
adventmedia opened this issue May 8, 2024 · 2 comments
Closed

Angular 17.3 input signal not working with customComponents #55739

adventmedia opened this issue May 8, 2024 · 2 comments

Comments

@adventmedia
Copy link

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

core

Is this a regression?

No

Description

Here is how a component is inserted in app.module using createCustomComponent:

const imgCaptionedElement = createCustomElement(ImgCaptionedComponent, { injector: this.injector });
customElements.define('img-captioned', imgCaptionedElement);

And here is the component:

@Component({
  selector: 'app-pic-captioned',
  templateUrl: './img-captioned.component.html',
  styleUrls: ['./img-captioned.component.scss'],
})
export class ImgCaptionedComponent implements OnInit {
  caption = input<string>();

  constructor() {}

  ngOnInit() {
    console.log('this.caption:', this.caption); // this.caption Mississauga
    console.log('this.caption()', this.caption()); // ERROR TypeError: this.caption is not a function
  }
}

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

in short, when created using `createCustomComponent`, the field `caption` returns, not the function, but the value. Furthermore it does not work at all in the html template.

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

Angular CLI: 17.3.7
Node: 18.19.0
Package Manager: npm 10.2.3
OS: darwin arm64

Angular: 17.3.7
... animations, cdk, cli, common, compiler, compiler-cli, core
... elements, forms, language-service, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.7
@angular-devkit/build-angular   17.3.7
@angular-devkit/core            17.3.7
@angular-devkit/schematics      17.3.7
@schematics/angular             17.3.7
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.5

Anything else?

No response

@JeanMeche
Copy link
Member

Hi, signal inputs not working we customElements is a known issue and is being track at #53981. Let's continue the discussion over there, thank you.

@JeanMeche JeanMeche closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants