title: Property 'forecast' is used before its initialization.ts(2729)
body: <p>I have this code which fetch a data from flask to angular and used that data inside an angular highchart. The problem is I cannot use the fetched data because it always prompt an error Property 'forecast' is used before its initialization.ts(2729), in my <code>this.forecast</code>. Below is my code.</p>
  <pre><code>**Forecast.ts** (this is the class file):
  
  export class Forecast {
      point:any;
      
      constructor(point){
          this.point = point;
      }
      
  }
  
  **try2.component.ts**
  
  import { Component, OnInit } from '@angular/core';
  import * as Highcharts from 'highcharts';
  import { PredictService } from '../predict.service';
  import { Forecast } from '../forecast'
  @Component({
    selector: 'app-try2',
    templateUrl: './try2.component.html',
    styleUrls: ['./try2.component.css']
  })
  export class Try2Component implements OnInit {
  
    constructor(private ps: PredictService) { }
     forecast: Forecast;
  
    ngOnInit(): void {
       
    this.ps.readForecast().subscribe ((response) =&gt; 
    {
      this.forecast = response[0][&quot;data&quot;];
  
    })}
    highcharts = Highcharts;
    chartOptions: Highcharts.Options = {
        chart: {
           type: &quot;spline&quot;
        },
        title: {
           text: &quot;Monthly Average Temperature&quot;
        },
        subtitle: {
           text: &quot;Source: WorldClimate.com&quot;
        },
        xAxis:{
           categories:[&quot;Jan&quot;, &quot;Feb&quot;, &quot;Mar&quot;, &quot;Apr&quot;, &quot;May&quot;, &quot;Jun&quot;,
              &quot;Jul&quot;, &quot;Aug&quot;, &quot;Sep&quot;, &quot;Oct&quot;, &quot;Nov&quot;, &quot;Dec&quot;]
        },
        yAxis: {          
           title:{
              text:&quot;Temperature °C&quot;
           } 
        },
        tooltip: {
           valueSuffix:&quot; °C&quot;
        },
        series: [{
           type: 'spline',
           name: 'Tokyo',
           data: [this.forecast] //Error Occured here
        
       }]
     };
  
  }
  </code></pre>