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

Template directive name check #49358

Closed
urielzen opened this issue Mar 7, 2023 · 2 comments
Closed

Template directive name check #49358

urielzen opened this issue Mar 7, 2023 · 2 comments

Comments

@urielzen
Copy link

urielzen commented Mar 7, 2023

Which @angular/* package(s) are relevant/related to the feature request?

compiler

Description

We have a large application using a complex architecture of NgModules, that we would like to refactor into standalone components.

We are using primarily primeNG component library. In the most basic example below pInputText directive from that same library.

 <input type="email" pInputText>

This requires the InputTextModule from primeNG, which in the original architecture is loaded into a SharedModule, but in the standalone components architecture InputTextModule needs to be imported in every component that uses the directive.

Proposed solution

Is there a way for the compiler to give warnings/errors if the template has directives that are not properly imported into the standalone component? This will help a lot with the refactoring to make sure we didn't miss importing any PrimeNG modules into the corresponding components.

Alternatives considered

Using text search to find all the uses of the directive is one way to do it... but very tedious and prone to errors if any file is missed by mistake.

@pkozlowski-opensource
Copy link
Member

This is really a duplicate of #46351

The root cause here is that our template syntax is not really distinguishing between directives and other attributes.

@pkozlowski-opensource pkozlowski-opensource closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2023
@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 7, 2023
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