title: how to fix property does not exit in Angular
body: <p>so I'm working on existing code base and I'm trying make the mat-form filed to get TextData that written in mam-chart.model.ts file but some reason I'm getting this error " ERROR TypeError: Cannot read property 'text' of undefined' ". I</p>
  
  <p>Any suggestion or help will be really apppreciated</p>
  
  <p>design.ts</p>
  
  <pre><code>import { Chart, TextData, ChartData} from 'src/app/mam-chart/models';
  export class ChartDesignComponent implements OnInit {
   chart: Chart;
   chartData: ChartData;
  }
  </code></pre>
  
  <p>design.html</p>
  
  <pre><code>            &lt;mat-form-field appearance="fill"&gt;
                  &lt;mat-label&gt;Text&lt;/mat-label&gt;
                  &lt;input matInput  [(ngModel)]="chartData.textData.text" /&gt;
              &lt;/mat-form-field &gt;
  
              &lt;mat-form-field appearance="fill"&gt;
                  &lt;mat-label&gt;Color(# + hex color code)&lt;/mat-label&gt;
                  &lt;input matInput [(ngModel)]="chartData.textData.color"/&gt;
              &lt;/mat-form-field &gt;
  </code></pre>
  
  <p>mam-chart.model.ts</p>
  
  <pre><code>export class Chart {
      id: number;
      chartType: ChartType = ChartType.chart;
      version: number = 2;
      dataType: ChartDataType = ChartDataType.static;
      template: ChartTemplate;
  
      .........
  
  }
  export class TextCard extends Chart {
      public chartData: CardDataChart;
  
      constructor(json?: any) {
          super(json)
          if (json == null) {
              return;
          }
          this.chartData = new ChartData(json.chartData);
      }
  }
  
  
  export class TextData {
      public text:  string;
      public color:  string;
      public size: string;
      public sizePx: number;
  
      constructor(json?: any) {
          if (json == null) {
              this.text = "";
              this.color = "";
              this.size = "";
              this.sizePx = 20;
              return;
          }
         ......
  
  export class ChartData {
      filteredData: FilteredData[];
      figures: Figure[];
      textData: TextData;
  }
  </code></pre>