title: TypeScript function inheritance
body: <p>I don't even know if this is possible in TypeScript, but I'm trying to inherit a function from a Class, like this:</p>
  
  <pre><code>import {Component, AfterViewInit, ElementRef} from 'angular2/core';
  
  @Component({})
  class Class1 {
    name: string;
    constructor(private el: ElementRef) {}
  
    private setName() {
      this.name = "test";
    }
  
    ngAfterViewInit() {
      this.setName();
    }
  }
  
  @Component({
    selector: 'test'
  })
  export class Class2 extends Class1 {
    ngAfterViewInit() {
      super.ngAfterViewInit();
      console.log(this.name);
    }
  }
  </code></pre>
  
  <p>but I'm getting the following error in console when calling the setName() function:</p>
  
  <blockquote>
    <p>EXCEPTION: TypeError: this.el is undefined</p>
  </blockquote>
  
  <p>Why isn't this working?</p>