Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 5, URLSearchParams in IE11

Tags:

angular

In my angular 5 application I have this following error:

Http error: {"description":"'URLSearchParams' non è definito","number":-2146823279,"stack":"ReferenceError: 'URLSearchParams' non è definito

URLSearchParams is not supported by IE11 so are there any kind of imports maybe in polyfills.ts to make it works?

like image 534
Alessandro Celeghin Avatar asked May 07 '18 14:05

Alessandro Celeghin


1 Answers

use URLSearchParams Polyfill

npm install url-search-params-polyfill --save

and import it in your polyfills.ts

import 'url-search-params-polyfill';

or to webpack config

entry: {
 bundle: [
  'url-search-params-polyfill',
  ...
 ]
}
like image 115
Fateh Mohamed Avatar answered Oct 21 '22 00:10

Fateh Mohamed