Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've heard a lot of talk about the second coming of Angular and there seems to be a lot of fantastic things coming out of it but I know that Angular 1.0 does not have out of the box integration for Web Components.

I've read up some about Angular2 and that it no longer uses directives. So I was wondering if that means Angular2 is going to make use of Polymer/HTML Templates and other Web Components without any extra integration?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.8k views
Welcome To Ask or Share your Answers For Others

1 Answer

update 2

That's now supported https://angular.io/guide/elements

update

There is an ongoing effort (currently only experimental) to change that - Angular elements https://moduscreate.com/blog/angular-elements-ngcomponents-everywhere/

original

Web components can be used in Angular2 applications, but Angular2 components can't be consumed as web components.

AFAIK there are no short-term plans to make Angular2 components actual web components. This was a goal at the beginning but turned out to be too complicated.

With the per component setting ViewEncapsulation.Native, shadow DOM is used, but that doesn't work too well in Angular2 because the browsers lack features to style the shadow DOM. Polymer uses emulated CSS variables and mixins but Angular2 doesn't yet provide anything like that.

Currently the default setting is ViewEncapsulation.Emulated where some style scoping is emulated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...