You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
When using RequestOptionsArgs Interface and then instantiate the params object with UrlSearchParams like so: request.options.params = new URLSearchParams();
I cannot use any function in UrlSearchParams Object. For example:
request.options.params.get('key') or request.options.params.paramsMap.get('key');
If I change the current interface to:
exportinterfaceRequestOptionsArgs{url?: string;method?: string|RequestMethod;/** @deprecated from 4.0.0. Use params instead. */search?: string|URLSearchParams|{[key: string]: any|any[];};params?: URLSearchParams;headers?: Headers;body?: any;withCredentials?: boolean;responseType?: ResponseContentType;}
Notice how i put just UrlSearchParams in as a type explicitly all is well.
Expected behavior
I expect to be able to use the functions associated with UrlSearchParams interface.
Minimal reproduction of the problem with instructions
create a class that uses RequestOptionsArgs
initalize params object with request.options.params = new UrlSearchParams()
try to use anything on params object. like request.options.params.get('key');
I get this TS error:
TS2339: Property 'get' does not exist on type 'string | URLSearchParams | { [key: string]: any; }'.
Property 'get' does not exist on type 'string'.
What is the motivation / use case for changing the behavior?
Not trying to change the behavior, but just trying to use it as it was designed to be used. Please tell us about your environment:
Mac OSX El Capitan, Webstorm IDE, yarn/npm, Webpack dev server for testing
Angular version: 4.0.X
Language: TypeScript 2.2.1
Node (for AoT issues):node --version = 6.1.0
The text was updated successfully, but these errors were encountered:
I'm submitting a ... (check one with "x")
Current behavior
When using RequestOptionsArgs Interface and then instantiate the params object with UrlSearchParams like so:
request.options.params = new URLSearchParams();
I cannot use any function in UrlSearchParams Object. For example:
request.options.params.get('key')
orrequest.options.params.paramsMap.get('key');
If I change the current interface to:
Notice how i put just UrlSearchParams in as a type explicitly all is well.
Expected behavior
I expect to be able to use the functions associated with UrlSearchParams interface.
Minimal reproduction of the problem with instructions
request.options.params = new UrlSearchParams()
params
object. likerequest.options.params.get('key');
I get this TS error:
What is the motivation / use case for changing the behavior?
Not trying to change the behavior, but just trying to use it as it was designed to be used.
Please tell us about your environment:
Mac OSX El Capitan, Webstorm IDE, yarn/npm, Webpack dev server for testing
Language: TypeScript 2.2.1
Node (for AoT issues):
node --version
= 6.1.0The text was updated successfully, but these errors were encountered: