Sitelet https://github.com/angular/angular/commit/ab0cfda53143cd57504c895e635611a60e7ed3dc
Skip to content

Commit ab0cfda

Browse files
splincodethePunderWoman
authored andcommitted
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 a783c4e)
1 parent 710c2c7 commit ab0cfda

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/platform-browser/src/dom/dom_renderer.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,11 +556,11 @@ function isTemplateNode(node: any): node is HTMLTemplateElement {
556556
}
557557

558558
class ShadowDomRenderer extends DefaultDomRenderer2 {
559-
private shadowRoot: any;
559+
private readonly shadowRoot: ShadowRoot;
560560

561561
constructor(
562562
eventManager: EventManager,
563-
private hostEl: any,
563+
private readonly hostEl: Element,
564564
component: RendererType2,
565565
doc: Document,
566566
ngZone: NgZone,
@@ -570,7 +570,7 @@ class ShadowDomRenderer extends DefaultDomRenderer2 {
570570
private sharedStylesHost?: SharedStylesHost,
571571
) {
572572
super(eventManager, doc, ngZone, tracingService, cssVarNamespace);
573-
this.shadowRoot = (hostEl as any).attachShadow({mode: 'open'});
573+
this.shadowRoot = hostEl.attachShadow({mode: 'open'});
574574

575575
// SharedStylesHost is used to add styles to the shadow root by ShadowDom.
576576
// This is optional as it is not used by ExperimentalIsolatedShadowDom.

0 commit comments

Comments
 (0)