title: How to display common header and footer by default in angular 2?
body: <p>I have common header components and footer components. countries list are loading on homepage. whenever click on the country. page will get reloaded and displaying text <code>Loading...</code> and then header and footer displaying. but I want to display the header and footer default without waiting for full page loaded. My code here. </p>
  
  <p><strong>app-routing.module.ts</strong></p>
  
  <pre><code>    const routes: Routes = [
        { path: '', redirectTo: '/home', pathMatch: 'full' },
        { path: 'home',  component: HomepageComponent,},
        { path: ':city', component: CountryDetailComponent },  
        { path: ':city/:subscategory', component: ExploreListComponent }, 
        { path: ':city/:subscategory/:singleitem', component: DetailedPageComponent },
      ];
  </code></pre>
  
  <p><strong>app.component.ts</strong></p>
  
  <pre><code>    import { Component } from '@angular/core';
  
      @Component({
        moduleId: module.id,
        selector: 'my-app',
        template: `
           &lt;app-header&gt;&lt;/app-header&gt;
          &lt;router-outlet&gt;&lt;/router-outlet&gt;
          &lt;app-footer&gt;&lt;/app-footer&gt;
        `, 
      })
      export class AppComponent { }
  </code></pre>
  
  <p><strong>header.component.ts</strong></p>
  
  <pre><code>    import { Component,Renderer } from '@angular/core';
      import { Title } from '@angular/platform-browser';
  
      @Component({
        moduleId: module.id,
        selector: 'app-header',
        template: `header html script`,
      })
  
      export class HeaderComponent { 
       constructor(title: Title) {  }
      }
  </code></pre>
  
  <p><strong>footer.component.ts</strong></p>
  
  <pre><code>    import { Component } from '@angular/core';      
  
      @Component({
        moduleId: module.id,
        selector: 'app-footer',
        template: `comman footer html script`,
  
      })
      export class FooterComponent {
  
      }
  </code></pre>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>    &lt;!doctype html&gt;
      &lt;html&gt;
          &lt;head&gt;
            &lt;meta charset="utf-8"&gt;
            &lt;title&gt;&lt;/title&gt;
            &lt;base href="/"&gt;
            &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
            &lt;link rel="icon" type="image/x-icon" href="favicon.ico"&gt;
            &lt;link href="assets/css/bootstrap.min.css" rel="stylesheet"&gt;
          &lt;/head&gt;
          &lt;body&gt;
             &lt;my-app&gt;Loading...&lt;/my-app&gt;     
          &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p><strong>homepage.component.ts</strong></p>
  
  <pre><code>  @Component({
      selector: 'my-app',
      templateUrl: 'homepage.component.html',
      styleUrls: ['homepage.component.css'],
      providers: [ CountriesService]
    })
  
    export class HomepageComponent {  
      ngOnInit() {             
                 }        
    }
  </code></pre>