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

refactor(common): create an NgFor alias for NgForOf directive #47309

Closed
wants to merge 1 commit into from

Conversation

AndrewKushnir
Copy link
Contributor

This commit adds a re-export of the NgForOf class as NgFor to improve the DX for cases when the directive is used as standalone. Developers can import NgFor class, which better matches the ngFor attribute used in a template.

PR Type

What kind of change does this PR introduce?

  • Refactoring (no functional changes, no api changes)

Does this PR introduce a breaking change?

  • Yes
  • No

@AndrewKushnir AndrewKushnir added state: WIP area: common Issues related to APIs in the @angular/common package target: patch This PR is targeted for the next patch release cross-cutting: standalone Issues related to the NgModule-less world labels Aug 31, 2022
@ngbot ngbot bot modified the milestone: Backlog Aug 31, 2022
@mary-poppins
Copy link

You can preview 3f4dba1 at https://pr47309-3f4dba1.ngbuilds.io/.

@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP labels Aug 31, 2022
@AndrewKushnir AndrewKushnir marked this pull request as ready for review August 31, 2022 18:27
@pullapprove pullapprove bot requested a review from dylhunn August 31, 2022 18:27
Copy link
Member

@pkozlowski-opensource pkozlowski-opensource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: public-api
Reviewed-for: fw-common

Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api

@JoostK
Copy link
Member

JoostK commented Sep 6, 2022

Should NgFor be the preferred thing for developers to use? If yes, we could update the extended diagnostic for an unknown control flow directive to mention NgFor instead of NgForOf (in KNOWN_CONTROL_FLOW_DIRECTIVES).

This commit adds a re-export of the `NgForOf` class as `NgFor` to improve the DX for cases when the directive is used as standalone. Developers can import `NgFor` class, which better matches the `ngFor` attribute used in a template.
@AndrewKushnir
Copy link
Contributor Author

Should NgFor be the preferred thing for developers to use? If yes, we could update the extended diagnostic for an unknown control flow directive to mention NgFor instead of NgForOf (in KNOWN_CONTROL_FLOW_DIRECTIVES).

@JoostK great point 👍 I've updated the KNOWN_CONTROL_FLOW_DIRECTIVES maps to refer to NgFor instead of NgForOf.

@mary-poppins
Copy link

You can preview 7b0b3d2 at https://pr47309-7b0b3d2.ngbuilds.io/.

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 7, 2022
@dylhunn
Copy link
Contributor

dylhunn commented Sep 9, 2022

This PR was merged into the repository by commit 710d1da.

@dylhunn dylhunn closed this in 710d1da Sep 9, 2022
dylhunn pushed a commit that referenced this pull request Sep 9, 2022
…7309)

This commit adds a re-export of the `NgForOf` class as `NgFor` to improve the DX for cases when the directive is used as standalone. Developers can import `NgFor` class, which better matches the `ngFor` attribute used in a template.

PR Close #47309
vyom1611 pushed a commit to vyom1611/angular that referenced this pull request Sep 18, 2022
…gular#47309)

This commit adds a re-export of the `NgForOf` class as `NgFor` to improve the DX for cases when the directive is used as standalone. Developers can import `NgFor` class, which better matches the `ngFor` attribute used in a template.

PR Close angular#47309
@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 Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker aio: preview area: common Issues related to APIs in the @angular/common package cross-cutting: standalone Issues related to the NgModule-less world target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants