These are chat archives for angular/angular-2-ionic-2

9th
Jan 2018
Dennis Belany
@azarus
Jan 09 2018 16:16
My Ionic2 project
won't reload the code of my service upon changes??? WUH?
texirv0203
@texirv0203
Jan 09 2018 17:20
hi,
  • using the below example, I am trying to implement appDyanmics in my code.
    https://github.com/derrekyoung/appd-sampleapp-angular2
  • but for some reason its not going inside constructor code constructor(public appRoutes:Router) {
  • I kept debugger and saw in the if statement still it didnt go inside.
  • can you tell me how to fix it.
  • providing my code below
import { ModuleWithProviders, NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { Router, Event, NavigationStart, NavigationEnd } from '@angular/router';
import { Base } from './components/base/base';

import { LoadingsWithOverlaps } from './components/Loading/Loadings-with-overlaps';
import { AiringFOXInfoPopup } from './components/Loading/airing-FOXinfo-popup';

import { Listings } from './components/listings/listings';

import { ScoringsMain } from './components/Scorings/ScoringsMain';
import { ScoringFOXTBA } from './components/Scorings/ScoringFOXTBA';
e';

const appRoutes: Routes = [
    {
        path: '',
        redirectTo: 'jumping',
        pathMatch: 'full'
    },

    {
        path: 'FlyingManagement',
        component: FlyingsHeader,
        children: [
            { path: '', redirectTo: 'FlyingSearch', pathMatch: 'full' },
            { path: 'FlyingSearch', component: FlyingSearch },
            {
                path: 'FlyingMain/:id', component: FlyingMain,
                children: [
                    { path: '', redirectTo: 'Base', component: FlyingCreateFill, pathMatch: 'full' },
                    { path: 'FlyingCreateFill', component: FlyingCreateFill, canDeactivate: [CanDeactivateGuard] },

                ]

            }
        ]

    },
    {
        path: 'Playing',
        component: Development

    },


];


export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
//export class AppRoutingModule { }
declare var ADRUM: any;


@NgModule({
  imports: [RouterModule.forRoot(appRoutes)],
  exports: [RouterModule],
  providers: []
})

export class AppRoutingModule {

   vpView: any;

//   // Subscribe to the Router URL changes.
  constructor(public appRoutes:Router) {
      console.log("appDyanmics-sample-constructor");
      this.appRoutes.events.subscribe((event:Event) => {
              if (event instanceof NavigationEnd) {
                console.debug('NavigationEnd: '+event.url);

                this.vpView.markViewChangeEnd();
                this.vpView.markViewDOMLoaded();
                this.vpView.markXhrRequestsCompleted();
                this.vpView.markViewResourcesLoaded();
                this.vpView.end();
                ADRUM.Scoring(this.vpView);

              } else if (event instanceof NavigationStart) {
                console.debug('NavigationStart: '+event.url);

                this.vpView = new ADRUM.events.VPageView();
                this.vpView.start();
                this.vpView.markViewChangeStart();
              }
          });
  }
}
UncertaintyP
@UncertaintyP
Jan 09 2018 18:50
@texirv0203 You may be more lucky in an angular room instead of ionic: https://gitter.im/angular/angular