title: Typescript method on class undefined
body: <p>In Typescript I have a class <code>Contact</code> which implements an interface <code>IContact</code>.
  I want to add a property or function to the <code>Contact</code> class which returns the combination of two other fields (firstname and lastname).
  The definition of the <code>IContact</code> interface looks like this:</p>
  
  <pre><code>export interface IContact {
      firstname: string;
      lastname: string;
  }
  </code></pre>
  
  <p>The <code>Contact</code> class look like this:</p>
  
  <pre><code>export class Contact implements IContact {
      constructor(
          public firstname: string,
          public lastname: string
      ) { }
  
      public fullname(): string {
          return this.firstname + " " + this.lastname;
      }
  }
  </code></pre>
  
  <p>In my view I want to output the result of <code>Contact.fullname()</code> but I receive an error that <code>fullname</code> is not a function.
  I do have access to all other properties on that class.</p>
  
  <p>==== UPDATE ===</p>
  
  <p>I'll add some extra code to clarify some stuff.
  When I output the <code>fullname</code> property in my view I have tried <code>contact.fullname()</code> but also <code>contact.fullname</code> which results in nothing.
  In my component, trying to figure out what was happening I tried to output <code>fullname</code> to the console like this: <code>console.log("FULLNAME " +contact.fullname());</code>, but that give me the following message in the console: <code>EXCEPTION _this.contact.fullname is not a function</code></p>
  
  <p>===== UPDATED WITH ANSWER ========</p>
  
  <p>As Sakuto stated correctly the list of contacts is created by some json received from the server. By creating a new instance entirely by calling it's constructor i was able to output the <code>fullname</code> property.
  Thanks Sakuto!</p>