/**
 * This file defines the root module of the Angular 2 of the application.
 */ import { NgModule , Component } from '@angular/core' ; import { RouterModule , UrlHandlingStrategy } from '@angular/router' ; import { BrowserModule } from '@angular/platform-browser' ; import { UpgradeModule } from '@angular/upgrade/static' ; import { RouterUpgradeInitializer } from '@angular/router/upgrade' ; import { MessagesNgModule } from './messages' ; import { MenuNgModule } from './menu' ; import { SettingsNgModule } from './settings' ; export class Ng1Ng2UrlHandlingStrategy implements UrlHandlingStrategy { shouldProcessUrl ( url ) { return url . toString ( ) . startsWith ( "/settings" ) ; } extract ( url ) { return url ; } merge ( url , whole ) { return url ; } } @ Component ( { selector : 'root-cmp' , template : `
    <router-outlet></router-outlet>
    <div class="ng-view"></div>
  ` , } ) export class RootCmp { } @ NgModule ( { imports : [ BrowserModule , UpgradeModule , MenuNgModule , MessagesNgModule , SettingsNgModule , RouterModule . forRoot ( [ ] ) ] , providers : [ { provide : UrlHandlingStrategy , useClass : Ng1Ng2UrlHandlingStrategy } ] , bootstrap : [ RootCmp ] , declarations : [ RootCmp ] } ) export class Ng2AppModule { constructor ( public upgrade ) { } }