title: Angular 5 input array from other component , cause length 0
body: <p>I put the collected data from services into the array. I put this array through @Input into the second component but in it the array instead of length 18 has 0;</p>
  
  <p>TS: </p>
  
  <pre><code>  arr: Datas[] = [];
  
  
    constructor(private dataService: DataService) {
    }
  
    ngOnInit() {
      console.log("ng init");
      this.getArraysFromData();
  
    }
  
    getArraysFromData() {
      this.DataService.getDatas().subscribe((data: Datas[]) =&gt; {
        for (let item of data) {
          this.arr.push(item);
        }
        console.log("smartlamps from Map ", this.arr);
      });
    }
  </code></pre>
  
  <p>}</p>
  
  <p>HTML : </p>
  
  <pre><code>&lt;app-osm-generator [dataInput]="arr"&gt;&lt;/app-osm-generator&gt;
  </code></pre>
  
  <p>COMPONENT WHERE I INPUT</p>
  
  <pre><code>@Input() dataInput: Datas[];
  
  
  ngOnInit(): void {
    this.takeDataFromInput();
  }
  
  takeDataFromInput() {
  console.log(this.dataInput.length);   &lt;-- is 0 must be 18
    for(let item of dataInput) { 
      console.log(item); 
    }
  }
  </code></pre>