I'm passing data into a child component that is accessible and I can build out my view using this data. But, I'm needing to access a property on the @Input object to "find" an item in an array with the same value. Fairly simple and straight forward. I'm doing this in my constructor function when the component loads so it's available right away.
BUT, the @Input object is coming back undefined so I cannot access the property. Can someone take a look and tell me what's going on here?
The Object that comes back undefined is "this.ConfirmOrderData" and like I said, I can do ngFor repeats on this objects property arrays etc, so I'm stumped why it is undefined.
CODE:
@Input() ConfirmOrderData:{
orderRefillData: Array<any>,
selectedUser: any,
DeliveryTypeId: any,
PickupLocationId: any,
PaymentTypeId: any,
AddressType: any
};
constructor(
fb: FormBuilder,
public refillService: refillService,
public globalService: globalService
) {
this.userInfo = this.globalService.getUserInfo();
this.deliveryAddress = this.userInfo.userInfo.StreetAddresses.find((item) => item.DeliveryTypeId == this.ConfirmOrderData.AddressType.AddressTypeId)
//the this.ConfirmOrderData object in the above line comes back undefined. Don't know why.
}