angular: API docs are missing for HttpParamsOptions
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
HttpParams
is documented on Angular.io, however its constructor takes HttpParamsOptions
that doesn’t link to a doc.
Expected behavior
We could infer the shape of HttpParamsOptions
from the source code, but it would be nice to describe, link to and search for it on the API portal.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
Angular 5.0.0
Others:
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 49
- Comments: 18 (11 by maintainers)
Commits related to this issue
- docs(common): add `HttpParamsOptions` to the public API Fixes #20276 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API Fixes #20276 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API Fixes #20276 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API Fixes #20276 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API Fixes #20276 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API Fixes #20276 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API Fixes #20276 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to angular/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to angular/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to jbogarthyde/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to angular/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to angular/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to leo6104/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to leo6104/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to gkalpak/angular by gkalpak 7 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to gkalpak/angular by gkalpak 5 years ago
- docs(common): add `HttpParamsOptions` to the public API (#20332) Fixes #20276 PR Close #20332 — committed to gkalpak/angular by gkalpak 5 years ago
- fix(common): add `HttpParamsOptions` to the public api Resolves #20276 — committed to rwlogel/angular by deleted user 4 years ago
How are things progressing on this issue?
I noticed it was created in 2017 and till now it still produces same result. By result I mean, that https://angular.io/api/common/http/HttpParams references HttpParamsOptions type, but this type has no reference and therefore doesn’t tell developer/user, what it provides/consists of.
To find answers one needs to go https://github.com/angular/angular/blob/master/packages/common/http/src/params.ts#L113, but it is painful, when there are docs.
Just note that HttpParams doesn’t add up to the previous params just like HttpSearchParams used to do.
`let body = new HttpParams(); body.set(‘some_var’, ‘value’); body.set(‘another_var’, ‘value’);
console.log(body.toString()); // will return null
body = body.set(‘some_var’, ‘value’); body = body.set(‘another_var’, ‘value’);
console.log(body.toString()); //will return the params`
@pickfire It means
HttpParamsOptions
interface is going to be inlined, so thatHttpParamsOptions
name doesn’t exist anymore, which becoming part of the constructor type directly.@gkalpak I believe that
HttpParamsOptions
should be referenced by public API for others to be able to override the encoder as it does not encode some characters such as+
and=
, See https://github.com/angular/angular/issues/26979 and https://github.com/angular/angular/issues/18261.The topic is not entirely correct, it’s not exported by the docs and also not exported by the public API, which is the real issue.
A public class with public constructor accepts a private interface, that’s the problem.
The fix is super easy here…