fix(http): introduce named type for HttpParams options (#19360)
This is necessary to enable type-based optimizations with Closure. Without explicity making these options the same named type, Closure thinks they are different types and cannot disambiguate the `fromObject` property.
This commit is contained in:

committed by
Victor Berchet

parent
dfb8d21ef4
commit
8a0e45826a
@ -15,7 +15,7 @@ import {map} from 'rxjs/operator/map';
|
||||
|
||||
import {HttpHandler} from './backend';
|
||||
import {HttpHeaders} from './headers';
|
||||
import {HttpParams} from './params';
|
||||
import {HttpParams, HttpParamsOptions} from './params';
|
||||
import {HttpRequest} from './request';
|
||||
import {HttpEvent, HttpResponse} from './response';
|
||||
|
||||
@ -366,7 +366,7 @@ export class HttpClient {
|
||||
if (options.params instanceof HttpParams) {
|
||||
params = options.params;
|
||||
} else {
|
||||
params = new HttpParams({fromObject: options.params});
|
||||
params = new HttpParams({ fromObject: options.params } as HttpParamsOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user