Child Code
import { Component, Input } from "@angular/core";
//import { Card, Item, List} from 'ionic-angular';
@Component({
selector: 'product',
templateUrl: 'product.component.html'
})
export class Product {
@Input() productObject: any;
product: any;
constructor(){
setTimeout( () => {
console.log(this.productObject);
this.product = this.productObject;
}, 1000)
}
}
The variable this.productObject
is always undefined
.
I am using it like this in the parent view,
<product [productObject]='product'></product>
Please note that it works perfect without the @Input. But it break as soon as I try to pass inputs to the component. Any help is highly appreciated.