title: Initialize Array in constructor and pass into map in Angular
body: <p>I am trying to create a model in angular and passing that into map function in service. I have one array in that model. When I pass that its showing <strong>undefined</strong> and except that array rest of the values are coming well. I think I am doing wrong in initializing and calling array. Can any tell me how to do it.</p>
  
  <p><strong>abc.ts</strong></p>
  
  <pre><code>export class ABC {
      date: Date;
      time: string;
      abc_Info: {
          item: string,
          quantity: number,
          a: number
      } []
      constructor(date: Date, time: string, abc_Info: []) {
          this.date = date;
          this.time = time;
          this.abc_Info = abc_Info;
      }
  }
  </code></pre>
  
  <p><strong>abc.service</strong></p>
  
  <pre><code>import { ABC} from './models/abc';
  getABC(start ? : moment.Moment, end ? : moment.Moment): Observable &lt; ABC[] &gt; {
      let params = new HttpParams();
      if (start) {
          params = params.append('start', start.toISOString());
      }
      if (end) {
          params = params.append('end', end.toISOString());
      }
      return this.baseService.getParams('/api/abc/getAll', params)
          .pipe(
              map(res =&gt; res as Object[] || []),
              map(bolus =&gt; bolus.map(k =&gt; new Bolus(
                      new Date(k['date']), //Value passing and coming well
                      k['time'], //Value passing and coming well
                      k['abc_Info'] //calling array here, showing undefined when i run
        ))))
  }
  </code></pre>
  
  <p><strong>Response In Back end, This is what I am getting into front end</strong></p>
  
  <pre><code>[
    {
      "date": "2019-01-18T18:30:00.000Z",
      "time": "2019-01-19T04:52:00.389Z",
      "abc_Info": [
        {
          "_id": "5c42acf9a0048b2a683be22a",
          "item": "Idly",
          "quantity": 15,
          "a": 30
        },
        {
          "_id": "5c42acf9a0048b2a683be229",
          "item": "Sandwitch",
          "quantity": 10,
          "a": 25
        },
        {
          "_id": "5c42acf9a0048b2a683be228",
          "item": "Sandwitch",
          "quantity": 20,
          "a": 25
        }
      ]
    }
  ]
  </code></pre>