@@ -11,11 +11,15 @@ import {
1111 HostBinding ,
1212 ElementRef ,
1313} from '@angular/core' ;
14- import { hasNoValue , hasValue , isNotEmpty } from '../empty.util' ;
1514import { combineLatest , from as fromPromise , Observable , of as observableOf , Subscription , BehaviorSubject } from 'rxjs' ;
1615import { ThemeService } from './theme.service' ;
1716import { catchError , switchMap , map , tap } from 'rxjs/operators' ;
1817import { GenericConstructor } from '../../core/shared/generic-constructor' ;
18+ import {
19+ hasNoValue ,
20+ hasValue , hasValueOperator ,
21+ isNotEmpty ,
22+ } from '../empty.util' ;
1923import { BASE_THEME_NAME } from './theme.constants' ;
2024
2125@Component ( {
@@ -54,6 +58,7 @@ export abstract class ThemedComponent<T> implements AfterViewInit, OnDestroy, On
5458 protected abstract getComponentName ( ) : string ;
5559
5660 protected abstract importThemedComponent ( themeName : string ) : Promise < any > ;
61+
5762 protected abstract importUnthemedComponent ( ) : Promise < any > ;
5863
5964 ngOnChanges ( changes : SimpleChanges ) : void {
@@ -82,9 +87,11 @@ export abstract class ThemedComponent<T> implements AfterViewInit, OnDestroy, On
8287 }
8388
8489 initComponentInstance ( changes ?: SimpleChanges ) {
85- this . themeSub = this . themeService ?. getThemeName$ ( ) . subscribe ( ( ) => {
86- this . renderComponentInstance ( changes ) ;
87- } ) ;
90+ this . themeSub = this . themeService ?. getThemeName$ ( )
91+ . pipe ( hasValueOperator ( ) )
92+ . subscribe ( ( ) => {
93+ this . renderComponentInstance ( changes ) ;
94+ } ) ;
8895 }
8996
9097 protected renderComponentInstance ( changes ?: SimpleChanges ) : void {
0 commit comments