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:
Jeremy Elbourn
2017-09-26 15:02:08 -07:00
committed by Victor Berchet
parent dfb8d21ef4
commit 8a0e45826a
3 changed files with 20 additions and 15 deletions

View File

@ -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);
}
}