We are going to continue using the mail app example, but this time we will add a new section, contacts, to our application. At launch, our application displays messages. Click the contacts button and it shows the contacts.
Let's start by sketching out our application:
main.ts: import {Component, NgModule} from '@angular/core'; import {RouterModule} from '@angular/router'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; @Component({...}) class MailAppCmp {} @Component({...}) class ConversationsCmp {} @Component({...}) class ConversationCmp {} @Component({...}) class ContactsCmp {} @Component({...}) class ContactCmp {} const ROUTES = [ { path: 'contacts', children: [ { path: '', component: ContactsCmp }, { path: ':id', component: ContactCmp } ] }, { path: ':folder', children: [ { path: '', component...