title: How to add a public or private property in the class using public method in ts
body: <p>I am trying to add a public or private variable in the class definition on calling a public method of a class for example in the class definition given below.</p>
  <pre><code>export default class Container {
    public addFlag(flagName: string): void {
       // create a new private or public property in class and assign a value to it.
    }
  }
  </code></pre>
  <p>If I make an instance of container class and call <code>addFlag()</code> on that instance, I want to add a public or private variable in the class definition and assign a value to it, how can i achieve this in Typescript ?.</p>