title: How to import class in another component in angular 2?
body: <p>I am new to Angular 2 and TypeScript and I'm trying to following code in which I want to use the variable of Test class in my another component viz header.</p>
  
  <pre><code>import { Component } from '@angular/core';
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
  }
  export class Test{
  static var1:number=10;
  }
  </code></pre>
  
  <p>var1 is static because I want to use it without making test instance.</p>
  
  <p>Code in the another component viz header</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import {Test} from '../app.component';
  @Component({
    selector: 'app-header',
    Template;`&lt;h1&gt; Hello&lt;/h1&gt;
              &lt;h1&gt;{{Test.var1}}&lt;/h1&gt;`
  })
  export class HeaderComponent implements OnInit {
    constructor() { }
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p>This code showing only hello not "10" which is a static variable.</p>
  
  <p>Thank you in advance.</p>