I have a component with a single child component which I cannot access and change to code to. In order to make something work I need to access a variable inside the child component onInit of the parent component, however the child component is always late. Is there a way for me to subscribe to the variable (I've tried with RxJS, however I had no luck, maybe I just did something wrong). I used the view child and I can access the variable later, however onInit it is still undefined, is there a way for me to wait for it inside the onInit and then call the rest of the functions?
@ViewChild("test") test;
ngOnInit() {
// console.log(this.test.model.test1);
// const subject = new BehaviorSubject(this.test.model.test1);
// subject.subscribe(console.log);
// this.test.model.test1.toPromise().then(res => {console.log(res)});
}