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

@Input({ required: true }) - Required inputs do not throw errors at build time #54747

Closed
ddamiankowalski opened this issue Mar 7, 2024 · 4 comments
Labels
needs reproduction This issue needs a reproduction in order for the team to investigate further

Comments

@ddamiankowalski
Copy link

ddamiankowalski commented Mar 7, 2024

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

core

Is this a regression?

No

Description

The application uses nx and @angular/core version 16.2.12, I am trying to use new features introduced in Angular version 16, specifically required inputs. When I try to do so, the component gets highlighted in my IDE with the message as I hover saying:

Missing binding for required input (name of input) of component (name of component)

Hovewer, the build is still successfull, and the application compiles successfully.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

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

Angular CLI: v16.2.12
Node: v18.12.1

Anything else?

No response

@JoostK
Copy link
Member

JoostK commented Mar 7, 2024

Required inputs are only checked when using the AOT compiler, and only if strictTemplates or at least fullTemplateTypeCheck is enabled (without those options, nested templates within a component are not type-checked, meaning that required inputs in nested templates aren't reported as well)

@JoostK
Copy link
Member

JoostK commented Mar 7, 2024

Can you confirm this is the case for you as well? If not, this would require a reproduction.

@JoostK JoostK added the needs reproduction This issue needs a reproduction in order for the team to investigate further label Mar 7, 2024
@ddamiankowalski
Copy link
Author

This is a case for me. I am very much sorry and thank you for the prompt reply. Switching the strictTemplates option to true absolutely solves my problem.

@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 Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs reproduction This issue needs a reproduction in order for the team to investigate further
Projects
None yet
Development

No branches or pull requests

2 participants