fix(demo): remove demo links from the repo

This commit is contained in:
Dmitry Nehaychik 2017-09-29 19:34:07 +03:00
parent ad145a67d8
commit 0235b61d9c
7 changed files with 19 additions and 30 deletions

View file

@ -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);
}
}