Skip to content

Commit

Permalink
removed child component test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremythuff committed Oct 1, 2020
1 parent 50f258e commit 7b6ab6c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class ComponentRegistryService {
}

getComponentByElement(element: HTMLElement): WvrBaseComponent {

const hasNativeId = element.hasAttribute('wvr-id');
const htmlID = hasNativeId ? element.getAttribute('wvr-id') : element.getAttribute('id');

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ export class WvrTabComponent extends WvrBaseComponent implements AfterViewInit {

ngAfterViewInit(): void {
const tabsElements: HTMLElement = (this._eRef.nativeElement as HTMLElement).closest('wvr-tabs');
this.parent = this.componentRegistry.getComponentByElement(tabsElements) as WvrTabsComponent;
this.parent.addTab(this);
if (tabsElements) {
this.parent = this.componentRegistry.getComponentByElement(tabsElements) as WvrTabsComponent;
this.parent.addTab(this);
} else {
console.warn('The wvr-tab component must be contained within a wvr-tabs component.');
}
}

getTabContent(): SafeHtml {
Expand Down

0 comments on commit 7b6ab6c

Please sign in to comment.