import { Injectable } from '@angular/core' ; import { Angulartics2 , Angulartics2Segment } from 'angulartics2' ; @ Injectable ( ) export class NSAngulartics2Segment extends Angulartics2Segment { constructor ( angulartics2 ) { super ( angulartics2 ) ; angulartics2 . pageTrack . subscribe ( ( x ) => this . pageTrack ( x . path , x . location ) ) ; angulartics2 . eventTrack . subscribe ( ( x ) => this . eventTrack ( x . action , x . properties ) ) ; angulartics2 . setUserProperties . subscribe ( ( x ) => this . setUserProperties ( x ) ) ; angulartics2 . setUserPropertiesOnce . subscribe ( ( x ) => this . setUserProperties ( x ) ) ; } public pageTrack ( path , location ) { } public eventTrack ( action , properties ) { } public setUserProperties ( properties ) { } }