I'm new to angular 2 and have a scenario where my service returns an object to my component and within the object there are a couple arrays.
One example is the 'phones' array.
In my view, I want to display each number in a list and I thought I could simple do the following:
<ion-item class="item-icon-left item-icon-right" id="contact-list-item8" *ngFor="let phone of contact.phones">
<i class="icon ion-ios-telephone"></i>
<small>{{phone.phone_type}} phone</small>
<br>
<a href="tel:{{phone.phone_number}}">{{phone.phone_number}}</a>
<i class="icon ion-ios-chatbubble-outline"></i>
</ion-item>
I know the contact object is right, because I'm able to display other fields form the object, but for the *ngFor look, I get "Cannot read property 'phones' of undefined".
What am I missing here?