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

docs: Update docs about equality. #54158

Closed
wants to merge 1 commit into from

Conversation

JeanMeche
Copy link
Member

Since v17, ngSwitch uses a strict equality.

Fixes #54156

@JeanMeche JeanMeche marked this pull request as ready for review January 30, 2024 13:36
@pullapprove pullapprove bot requested a review from alxhub January 30, 2024 13:36
@angular-robot angular-robot bot added the area: docs Related to the documentation label Jan 30, 2024
@ngbot ngbot bot added this to the Backlog milestone Jan 30, 2024
Since v17, `ngSwitch` uses a strict equality.

Fixes angular#54156
@JeanMeche JeanMeche force-pushed the docs/ngswitch-equality branch from c76c3a6 to 8ee1156 Compare January 30, 2024 13:49
@@ -192,8 +192,8 @@ export class NgSwitch {
* that defines the subtree to be selected if the value of the match expression
* matches the value of the switch expression.
*
* Unlike JavaScript, which uses strict equality, Angular uses loose equality.
* This means that the empty string, `""` matches 0.
* As of Angular v17 the NgSwitch directive uses strict equality comparison (`===`) instead of

Choose a reason for hiding this comment

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

I wonder if we need to mention v17 explicitly here. Normally the docs should reflect the current state (people can always access docs for the previous versions if needed).

Copy link
Member Author

Choose a reason for hiding this comment

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

It puts the rest of the sentence into a context.
I've no strong feeling about, but if we remove the mention of the version I'd also remove the end the sentence.

Copy link
Contributor

@sonukapoor sonukapoor Jan 31, 2024

Choose a reason for hiding this comment

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

If it was not strict before v17, then this information is useful.

@pkozlowski-opensource pkozlowski-opensource added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jan 31, 2024
@pkozlowski-opensource pkozlowski-opensource removed the request for review from alxhub January 31, 2024 15:07
jessicajaniuk pushed a commit that referenced this pull request Jan 31, 2024
Since v17, `ngSwitch` uses a strict equality.

Fixes #54156

PR Close #54158
@jessicajaniuk
Copy link
Contributor

This PR was merged into the repository by commit 4a44f73.

@JeanMeche JeanMeche deleted the docs/ngswitch-equality branch February 29, 2024 13:40
@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 Mar 31, 2024
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 area: docs Related to the documentation target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update ngSwitchCase docs
5 participants