最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - URL Polyfill for IE11 - Stack Overflow

matteradmin3PV0评论

I am creating a URL in my angular app using new URL as below. This works on all browsers except IE11.

So I tried to add "url-polyfill" to my "package.json" and used import 'url-polyfill' in polyfills.ts file.

But still i am getting object doesn't support action error for this line in IE11. Can anyone provide some thoughts on what i am doing wrong here.

 url = new URL(url).pathname.toLowerCase()

I am creating a URL in my angular app using new URL as below. This works on all browsers except IE11.

So I tried to add "url-polyfill" to my "package.json" and used import 'url-polyfill' in polyfills.ts file.

But still i am getting object doesn't support action error for this line in IE11. Can anyone provide some thoughts on what i am doing wrong here.

 url = new URL(url).pathname.toLowerCase()
Share Improve this question asked Nov 27, 2019 at 13:42 Deadpool_erDeadpool_er 2551 gold badge4 silver badges25 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

Angular includes imports to core-js@3 (you don't need to install something), so try these polyfills instead:

import 'core-js/features/url';
import 'core-js/features/url-search-params';
Post a comment

comment list (0)

  1. No comments so far