1
+ import { ActivatedRoute , NavigationEnd , Router } from '@angular/router' ;
1
2
import { Component , Inject , OnDestroy , Renderer } from '@angular/core' ;
2
- import { NavigationEnd , Router } from '@angular/router' ;
3
+ import { DOCUMENT } from '@angular/common' ;
4
+
3
5
import { isBs3 , setTheme } from 'ngx-bootstrap/utils' ;
4
6
import { routes } from '../../app.routing' ;
5
7
import { StyleManager } from '../../theme/style-manager' ;
6
8
import { ThemeStorage } from '../../theme/theme-storage' ;
7
- import { DOCUMENT } from '@angular/common' ;
9
+
8
10
import { Subscription } from 'rxjs' ;
9
11
10
12
const _bs3Css = 'assets/css/bootstrap-3.3.7/css/bootstrap.min.css' ;
@@ -28,13 +30,15 @@ export class SidebarComponent implements OnDestroy {
28
30
scrollSubscription : Subscription ;
29
31
30
32
constructor (
31
- public styleManager : StyleManager ,
33
+ private activatedRoute : ActivatedRoute ,
34
+ private renderer : Renderer ,
32
35
private router : Router ,
33
36
private themeStorage : ThemeStorage ,
34
- private renderer : Renderer ,
37
+ public styleManager : StyleManager ,
35
38
@Inject ( DOCUMENT ) private document : any
36
39
) {
37
- const currentTheme = this . themeStorage . getStoredTheme ( ) ;
40
+ const themeFromUrl = this . activatedRoute . snapshot . queryParams . _bsVersion ;
41
+ const currentTheme = themeFromUrl || this . themeStorage . getStoredTheme ( ) ;
38
42
if ( currentTheme ) {
39
43
this . installTheme ( currentTheme ) ;
40
44
}
0 commit comments