-
Notifications
You must be signed in to change notification settings - Fork 8k
/
Copy pathstarter.component.ts
61 lines (55 loc) · 1.44 KB
/
starter.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import {Component, OnDestroy} from '@angular/core';
import {NbMediaBreakpoint, NbThemeService} from '@nebular/theme';
import {Router} from '@angular/router';
import {AnalyticsService} from '../@core/utils';
import {CurrentThemeService} from '../@core/utils/theme.service';
@Component({
selector: 'ngx-starter',
templateUrl: './starter.component.html',
styleUrls: ['./starter.component.scss'],
})
export class NgxStarterComponent implements OnDestroy {
breakpoint: NbMediaBreakpoint;
breakpoints: any;
themes = [
{
value: 'material-light',
name: 'Material Light',
},
{
value: 'dark',
name: 'Dark',
},
{
value: 'default',
name: 'Light',
},
{
value: 'material-dark',
name: 'Material Dark',
},
{
value: 'corporate',
name: 'Corporate',
},
{
value: 'cosmic',
name: 'Cosmic',
},
];
constructor(private router: Router,
private themeService: NbThemeService,
private currentThemeService: CurrentThemeService,
private analytics: AnalyticsService,
) {}
navigate(themeName: string) {
this.currentThemeService.setCurrentTheme(themeName);
this.themeService.changeTheme(themeName);
this.router.navigate(['/pages/dashboard'], {queryParams: {theme: themeName}});
}
trackEmailClick() {
this.analytics.trackEvent('clickContactEmail', 'click');
}
ngOnDestroy() {
}
}