In one of my component's template input element I have created two different reference variables, something like this:
<input type="text" placeholder="..." #typeAhead="ngbTypeahead"
#relationTypeInput>
P.S: This is not the exact code, but my actual code is similar to this one
In the component ts file these variable are declared as follows:
@ViewChild('typeAhead') typeAhead: NgbTypeahead;
@ViewChild('relationTypeInput') relationTypeInput: ElementRef;
Then I am using the former one in ngOnInit() and the later one in ngAfterViewInit(). To my surprise I didn't got any error and it's working, but I don't understand how?