-
Notifications
You must be signed in to change notification settings - Fork 26.9k
docs: clarify documentation about listening to progress events #28892
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
Conversation
|
You can preview 8bf66c1 at https://pr28892-8bf66c1.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove changes here and just add the note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is not observe default value body? So that observe: 'events' is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm mistaken, providing an HttpRequest instance returns an observable of events by default.
https://github.com/angular/angular/blob/master/packages/common/http/src/client.ts#L497
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I see. I was confused by different syntax of new HttpRequest() vs httpClient.request(). Will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes still needed then in context of the example?
aio/content/guide/http.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to the existing note instead of two notes right next to each other.
Add `observe: 'events'` to see all events, including the progress of transfers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text still needs to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry I missed that.
Since, as you pointed out, observing events is default when sending request with HttpRequest, is there some wording to clarify that observe: events is needed when using the HttpClient.request with config object syntax?
If using
HttpClient.request('POST', '/url', config)syntax, addobserve: 'events'to see all events, including the progress of transfers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
"When using the HttpClient#request() method with an HTTP verb, configure with observe: 'events' to see all events, including the progress of transfers."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
|
You can preview c39b69e at https://pr28892-c39b69e.ngbuilds.io/. |
|
You can preview c07dcc1 at https://pr28892-c07dcc1.ngbuilds.io/. |
|
You can preview d0a672b at https://pr28892-d0a672b.ngbuilds.io/. |
|
@oBusk will you rebase on master so the preview job can finish correctly? And also squash down to a single commit. Thanks |
|
You can preview 8df1697 at https://pr28892-8df1697.ngbuilds.io/. |
|
Couple more changes.
|
|
You can preview 5fb1e31 at https://pr28892-5fb1e31.ngbuilds.io/. |
|
Thanks @oBusk! |
|
@brandonroberts Thanks for the feedback! 👍 🎆 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #28886
What is the new behavior?
Added
observe: 'events'to the example code as well as added small section mentioning that it is needed.Does this PR introduce a breaking change?
Other information
Closes #28886