I am setting a variable outside the constructor and I am using the variable in my template, but it is not assigning. How can I achieve that?

```
@Component({
  selector: 'footer',
  template: `
    <div>
      {{id}} {{name}} {{ans}}
    </div>
  `,
})
export class App {
  id:number;
  name:string;
  ans:string;
  constructor() {
    this.id = `1`,
    this.name = `App`
  }
  king = ()=>{
    this.ans = "variable";
    alert("Working");
  }
}

var sapp = new App();
sapp.king();

```

Here is [a plunker I made](https://plnkr.co/edit/JPq8W5sc8iyhLz2mfAoX?p=preview).