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:

https://angular.io/api/common/http/

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 49
  • Comments: 18 (11 by maintainers)

Commits related to this issue

Most upvoted comments

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 that HttpParamsOptions name doesn’t exist anymore, which becoming part of the constructor type directly.

HttpParamsOptions should not be referenced by public API.

@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…