Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How angular2 is going to use shadow dom while it's not supported in some popular browsers?

From the documentations:

When a component is instantiated, Angular

creates a shadow DOM for the component.
loads the selected template into the shadow DOM.
creates a child Injector which is configured with the appInjector for the Component.

But, as far as I know, shadow DOM is not supported yet in IE, Safari, and even in default configuration of Firefox!
Considering the fact that shadow DOM is not a feature that can be easily added to browser via a js library or something, how will be browser support for angular2?

PS: forgive me for calling IE and Safari (specifically IE) popular browsers!

like image 780
Alireza Mirian Avatar asked Mar 15 '23 20:03

Alireza Mirian


1 Answers

Angular 2 has two modes for Shadow DOM: emulated & native. In other words, browsers without Shadow DOM support will get an effective but slower polyfill.

Discussion & Source code

like image 129
shmck Avatar answered Apr 06 '23 08:04

shmck