title: How is ngFor able to loop through and find some objects while others are undefined?
body: <p>So this problem is driving me crazy. My friend has some code, and when he uses <code>*ngFor</code> and loops through, he is able to find the properties of his object. He uses an array that contains an object just like I am doing.</p>
  
  <p>When I try to do it, it comes out <code>undefined</code>.</p>
  
  <p>I've tried debugging the code and the problem is that the loop does not find the properties. </p>
  
  <p><strong>app-user-item component:</strong></p>
  
  <pre><code>import { Component, OnInit, Input } from '@angular/core';
  
  @Component({
    selector: 'app-user-item',
    templateUrl: './user-item.component.html',
    styleUrls: ['./user-item.component.scss']
  })
  export class UserItemComponent implements OnInit {
  
  
  @Input() fields : string[];
  
  
    constructor() { 
  
    }
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p><strong>app-user-item template:</strong></p>
  
  <pre><code>&lt;h1&gt;fields.name&lt;/h1&gt;
  &lt;h1&gt;fields.destination&lt;/h1&gt;
  </code></pre>
  
  <p>app-user-list component:</p>
  
  <pre><code>import { Component, OnInit, } from '@angular/core';
  import { stringify } from '@angular/core/src/render3/util';
  
  @Component({
    selector: 'app-user-list',
    templateUrl: './user-list.component.html',
    styleUrls: ['./user-list.component.scss']
  })
  export class UserListComponent implements OnInit {
  
    fields = [{
      name: "Ian",
      destination: "USA"
    },
    {
      name: "Jesse",
      destination: "Japan"
    }
  
  ];
  
  
  
    constructor() {
  
  
     }
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p><strong>app-user-list template:</strong></p>
  
  <pre><code>&lt;ul&gt;
    &lt;li *ngFor= "let field of fields"&gt;
  
      &lt;app-user-item [fields] = "field"&gt; &lt;/app-user-item&gt;
  
    &lt;/li&gt;
  
  &lt;/ul&gt;
  </code></pre>
  
  <p>The problem is I am getting <code>undefined</code> for <code>fields.name</code> and <code>fields.destination</code></p>
  
  <p>I am able to <code>console.log(fields)</code> and I get an object, but why is it not reading the property?</p>