import { Component, provide } from 'angular2/core'; import { Router, RouteConfig, RouterLink, RouterOutlet, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from 'angular2/router'; import { LocationStrategy, Location, HashLocationStrategy } from 'angular2/router'; import { NgClass } from 'angular2/common'; import {Angulartics2} from 'angulartics2'; import {Angulartics2GoogleAnalytics} from 'angulartics2/src/providers/angulartics2-google-analytics'; declare var moment: any; import { FooterComponent } from './common/footer/footer.component'; import { SidemenuComponent } from './common/sidemenu/sidemenu.component'; import { APIService } from './common/hankr-api/api.service'; import { ConfigurationService } from './common/configuration-service/configuration.service'; import { HomeComponent } from './home/home.component'; @Component({ selector: 'my-app', templateUrl: 'app/app.component.html', directives: [ ROUTER_DIRECTIVES, NgClass, FooterComponent, SidemenuComponent ], providers: [ ROUTER_PROVIDERS, provide(LocationStrategy, { useClass: HashLocationStrategy }), APIService, ConfigurationService, Angulartics2, Angulartics2GoogleAnalytics ] }) @RouteConfig([ { path: '/', name: 'Home', component: HomeComponent, useAsDefault: true } ]) export class AppComponent { title = 'xxxxxx'; baseUrl: string; today: string = moment().format('YYYY-MM-DD hh:mm:ss a'); constructor( ConfigurationService: ConfigurationService, angulartics2: Angulartics2//, //angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics ) { this.baseUrl = ConfigurationService.getBaseUrl(); //console.log('config.baseUrl: ' + this.baseUrl); } }