When attempting to access an object's data within a constructor, it results in an "undefined" object. Even though it functions properly in the ngOnInit() function, the data which is about to be reset is required every time the component is initiated.
import { Component, OnInit, Input } from '@angular/core';
@Input() data: any;
constructor(dataService: DataService)
{
console.log(this.data); // returns undefined
}
ngOnInit()
{
console.log(this.data) // functions correctly here
}