angular-cn/aio/content
cexbrayat 91cdc11aa0 fix(common): allow number or boolean as http params (#40663)
This change fixes an incompatibility between the old `@angular/http` package
and its successor (`@angular/common/http`) by re-introducing the types that were supported before.

It now allows to use number and boolean directly as HTTP params, instead of having to convert it to string first.

Before:

    this.http.get('/api/config', { params: { page: `${page}` } });

After:

    this.http.get('/api/config', { params: { page }});

`HttpParams` has also been updated to have most of its methods accept number or boolean values.

Fixes #23856

BREAKING CHANGE:

The methods of the `HttpParams` class now accept `string | number | boolean`
instead of `string` for the value of a parameter.
If you extended this class in your application,
you'll have to update the signatures of your methods to reflect these changes.

PR Close #40663
2021-02-26 12:03:50 -08:00
..
cli docs: update boolean and enumerated CLI section (#40224) 2020-12-23 09:51:29 -08:00
cli-src build(docs-infra): make the git ref for cli command docs configurable (#26391) 2018-10-11 12:57:49 -07:00
errors fix(docs-infra): use relative URLs for internal links on error pages (#40881) 2021-02-19 09:14:59 -08:00
examples docs: update docs to use new zone.js entry-points (#40823) 2021-02-24 07:58:29 -08:00
guide fix(common): allow number or boolean as http params (#40663) 2021-02-26 12:03:50 -08:00
images docs: improve accessibility of toh2 example (#40575) 2021-02-23 10:41:05 -08:00
marketing fix(docs-infra): add links to glossary for terms on the "Press kit" page (#40945) 2021-02-26 08:28:22 -08:00
start docs: remove unnecessary `<hr />` tags in Getting Started sections (#40693) 2021-02-16 08:00:42 -08:00
tutorial docs: improve accessibility of toh2 example (#40575) 2021-02-23 10:41:05 -08:00
file-not-found.md fix(docs-infra): do not create an anchor for the `file-not-found` header (#27250) 2018-12-05 13:26:26 -08:00
license.md docs: update year (#40925) 2021-02-22 12:37:40 -08:00
navigation.json docs: improve accessibility of toh-pt5 example (#40632) 2021-02-23 10:39:13 -08:00