title: Add class to body on Angular2
body: <p>I have three components. These are HomeComponent, SignInComponent and AppComponent. My Home Page (HomeComponent) is showing when the application opened. I clicked the "Sign In" button by signin page opens.I want "signin-page" class to body while opening it.</p>
  
  <p>How can I do it?</p>
  
  <pre><code>// AppComponent
  import { Component } from '@angular/core';
  
  @Component({
    moduleId: module.id,
    selector: 'app',
    template: '&lt;router-outlet&gt;&lt;/router-outlet&gt;'
  })
  export class AppComponent {}
  
  // SignInComponent
  import { Component } from '@angular/core';
  
  @Component({
      moduleId: module.id,
      selector: 'signin',
      templateUrl: './signin.component.html',
      styleUrls: ['./signin.component.css']
  })
  export class SignInComponent {}
  
  // HomeComponent
  import { Component } from '@angular/core';
  
  @Component({
      moduleId: module.id,
      selector: 'home',
      templateUrl: './home.component.html'
  })
  export class HomeComponent { }
  
  // Part of index.html
  &lt;body&gt;
  &lt;app&gt;
      &lt;div class="spinner"&gt;
          &lt;div class="bounce1"&gt;&lt;/div&gt;
          &lt;div class="bounce2"&gt;&lt;/div&gt;
          &lt;div class="bounce3"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/app&gt;
  &lt;/body&gt;
  </code></pre>