mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-21 01:40:13 +01:00
chore(analytics): track theme switch and start search events
This commit is contained in:
parent
6ef5f90f7c
commit
c28cf8f2d4
4 changed files with 17 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
import { NbJSThemeOptions } from '@nebular/theme/services/js-themes/theme.options';
|
||||
import { AnalyticsService } from '../../../@core/utils/analytics.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-theme-switcher',
|
||||
|
|
@ -19,7 +20,7 @@ import { NbJSThemeOptions } from '@nebular/theme/services/js-themes/theme.option
|
|||
export class ThemeSwitcherComponent implements OnInit {
|
||||
theme: NbJSThemeOptions;
|
||||
|
||||
constructor(private themeService: NbThemeService) {
|
||||
constructor(private themeService: NbThemeService, private analyticsService: AnalyticsService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
@ -30,6 +31,7 @@ export class ThemeSwitcherComponent implements OnInit {
|
|||
toggleTheme(theme: boolean) {
|
||||
const boolTheme = this.boolToTheme(theme);
|
||||
this.themeService.changeTheme(boolTheme);
|
||||
this.analyticsService.trackEvent('switchTheme');
|
||||
}
|
||||
|
||||
currentBoolTheme() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue