title: Angular undefined attribut but it's not possible
body: <p>I'm trying to get local JSON data with angular.
  My component:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import datalist from '../todolist.json';
  
  console.log(JSON.stringify(datalist));
  @Component({
    selector: 'app-todolist',
    templateUrl: './todolist.component.html',
    styleUrls: ['./todolist.component.css']
  })
  export class TodolistComponent implements OnInit {
  
    // will contain all data from ../todolist.json
    lists: any[];
    todolist: any;
  
    constructor() {}
  
    ngOnInit() {
      const test = Object.keys(datalist);
      for (const prop of test) {
        this.lists.push(datalist[prop]);
      }
    }
  }
  </code></pre>
  
  <p>And I get this error:</p>
  
  <blockquote>
    <p>ERROR TypeError: "this.lists is undefined"</p>
  </blockquote>
  
  <p>What am I doing wrong ? I really don't understand, of course, that <code>this.lists</code> is defined...</p>