mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
refactor(platform-browser): type shadow DOM renderer fields
Use DOM API types for the host element and shadow root instead of `any`.
(cherry picked from commit a783c4e7b7)
This commit is contained in:
committed by
Jessica Janiuk
parent
710c2c7857
commit
ab0cfda531
@@ -556,11 +556,11 @@ function isTemplateNode(node: any): node is HTMLTemplateElement {
|
||||
}
|
||||
|
||||
class ShadowDomRenderer extends DefaultDomRenderer2 {
|
||||
private shadowRoot: any;
|
||||
private readonly shadowRoot: ShadowRoot;
|
||||
|
||||
constructor(
|
||||
eventManager: EventManager,
|
||||
private hostEl: any,
|
||||
private readonly hostEl: Element,
|
||||
component: RendererType2,
|
||||
doc: Document,
|
||||
ngZone: NgZone,
|
||||
@@ -570,7 +570,7 @@ class ShadowDomRenderer extends DefaultDomRenderer2 {
|
||||
private sharedStylesHost?: SharedStylesHost,
|
||||
) {
|
||||
super(eventManager, doc, ngZone, tracingService, cssVarNamespace);
|
||||
this.shadowRoot = (hostEl as any).attachShadow({mode: 'open'});
|
||||
this.shadowRoot = hostEl.attachShadow({mode: 'open'});
|
||||
|
||||
// SharedStylesHost is used to add styles to the shadow root by ShadowDom.
|
||||
// This is optional as it is not used by ExperimentalIsolatedShadowDom.
|
||||
|
||||
Reference in New Issue
Block a user