8000 fix(common): rename httpResource function in factory by cexbrayat · Pull Request #60022 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content

fix(common): rename httpResource function in factory #60022

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 occasiona 8000 lly send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cexbrayat
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

As the function in the factory was named httpResourceRef, error NG0203 had with the following message:

Error: NG0203: httpResourceRef() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`. Find more at https://angular.dev/errors/NG0203

What is the new behavior?

The new message mentions httpRessource as shown by the added unit test

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from AndrewKushnir February 19, 2025 21:02
@angular-robot angular-robot bot added the area: common Issues related to APIs in the @angular/common package label Feb 19, 2025
@ngbot ngbot bot added this to the Backlog milestone Feb 19, 2025
@AndrewKushnir AndrewKushnir requested review from alxhub and removed request for AndrewKushnir February 20, 2025 00:32
@JeanMeche JeanMeche requested review from thePunderWoman and removed request for alxhub April 29, 2025 20:02
@JeanMeche JeanMeche force-pushed the fix/http-resource-ng0203 branch from c3785e4 to 24d8a46 Compare April 29, 2025 20:02
@JeanMeche
Copy link
Member

Nice catch — the error message highlights the importance of the function name.

Copy link
Contributor
@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

As the function in the factory was named `httpResourceRef`, error NG0203 had with the following message:

```
Error: NG0203: httpResourceRef() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`. Find more at https://angular.dev/errors/NG0203
```
@thePunderWoman thePunderWoman force-pushed the fix/http-resource-ng0203 branch from 24d8a46 to 2328615 Compare April 30, 2025 10:52
@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release labels Apr 30, 2025
@ngbot
Copy link
ngbot bot commented Apr 30, 2025

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "google-internal-tests" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@thePunderWoman
Copy link
Contributor

Caretaker note: this is safe to merge. the presubmit failures are unrelated.

@thePunderWoman thePunderWoman added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Apr 30, 2025
@mmalerba
Copy link
Contributor

This PR was merged into the repository by commit fc4a56d.

The changes were merged into the following branches: main

@mmalerba mmalerba closed this in fc4a56d Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: common Issues related to APIs in the @angular/common package merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0