-
-
Save akkumar/800290b220a9f9d1aace6eed0216ad94 to your computer and use it in GitHub Desktop.
Angular Material Theming - overlay handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { OverlayContainer} from '@angular/cdk/overlay'; | |
export class AppComponent implements OnInit { | |
// use this to set correct theme class on app holder | |
// eg: <div [class]="themeClass">...</div> | |
themeClass: string; | |
overlayContainer; | |
constructor( | |
private overlayContainer: OverlayContainer | |
) {} | |
ngOnInit(): void { | |
// subscribe to some source of theme change events, then... | |
this.themeClass = newThemeClass; | |
this.overlayContainer.themeClass = newThemeClass; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment