Get properties in Angular 2 using Typescript
<p>I'm trying to make the property <code>fullName</code> display the first and the last name. How to make the get property to work?</p>

<p>See this <a href="http://plnkr.co/edit/MFg3la" rel="noreferrer">Plunk</a>.</p>

<pre><code>import { Component } from '@angular/core';

export class Person {
  id: number;
  firstName: string;
  lastName: string;
  get fullName(): string {
    return this.firstName + ' ' + this.lastName;
  }
}

@Component({
  selector: 'my-app',
  template:`
    &lt;h1&gt;{{title}}&lt;/h1&gt;
    &lt;p&gt;My first name is {{person.firstName}}&lt;/p&gt;
    &lt;p&gt;My last name is {{person.lastName}}&lt;/p&gt;
    &lt;h2&gt;My full name is {{person.fullName}}!&lt;/h2&gt;`
})
export class AppComponent {
  title = 'Get property issue';
  person: Person = {
    id: 1,
    firstName: 'This',
    lastName: 'That'
  };
}
</code></pre>

<p><strong>EDIT</strong>
What I actually wanted to achieve was how to use get properties when calling a service and subscribing for the result. But I managed to figure it out based on below answers. Thanks!</p>

<p>See my updated <a href="http://plnkr.co/edit/CtheWE" rel="noreferrer">plunk</a></p>