declare var PR ; import { Component } from '@angular/core' ; import { Router , NavigationEnd } from '@angular/router' ; @ Component ( { selector : 'ngui-map-app' , templateUrl : './app.html' , } ) export class AppComponent { public center = 'Brampton, Canada' ; public positions = [ ] ; constructor ( router ) { router . events . subscribe ( event => { if ( document . querySelector ( '.prettyprinted' ) ) { document . querySelector ( '.prettyprinted' ) . classList . remove ( 'prettyprinted' ) ; } if ( event instanceof NavigationEnd ) { setTimeout ( e => PR . prettyPrint ( ) , 500 ) ; } } ) ; } }