Trying to get the component\'s @Input value in constructor or ngOnInit. But it is coming as undefined all the time.
@Input
constructor
ngOnInit
undefined
In the ngOninit method use,
ngOnInit() { if(this.hero) console.log('hero', this.hero); }