mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-20 15:04:07 +01:00
fix(demo): remove demo links from the repo
This commit is contained in:
parent
ad145a67d8
commit
0235b61d9c
7 changed files with 19 additions and 30 deletions
|
|
@ -1,30 +1,30 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Router, NavigationEnd} from '@angular/router';
|
||||
import {Location} from '@angular/common';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
import {filter} from 'rxjs/operator/filter';
|
||||
import { filter } from 'rxjs/operator/filter';
|
||||
|
||||
declare const ga: any;
|
||||
|
||||
@Injectable()
|
||||
export class AnalyticsService {
|
||||
private _enabled: boolean;
|
||||
private enabled: boolean;
|
||||
|
||||
constructor(private _location: Location, private _router: Router) {
|
||||
this._enabled = window.location.href.indexOf('akveo.com') >= 0;
|
||||
constructor(private location: Location, private router: Router) {
|
||||
this.enabled = false;
|
||||
}
|
||||
|
||||
trackPageViews() {
|
||||
if (this._enabled) {
|
||||
filter.call(this._router.events, (event) => event instanceof NavigationEnd)
|
||||
if (this.enabled) {
|
||||
filter.call(this.router.events, (event) => event instanceof NavigationEnd)
|
||||
.subscribe(() => {
|
||||
ga('send', {hitType: 'pageview', page: this._location.path()});
|
||||
ga('send', {hitType: 'pageview', page: this.location.path()});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
trackEvent(eventName: string) {
|
||||
if (this._enabled) {
|
||||
if (this.enabled) {
|
||||
ga('send', 'event', eventName);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue