I read a tab menu via a directive and an event. I get the right index and most likely the right element. Now I would like to animate the ElementRef to be able to animate it, but I can not find it. It is not templateRef and not origin. Can somebody tell me how to find the current element and how to fix it when I change the tab?
The below code is a simple color change example to see if I have the correct element; my final goal is to be able to animate the content via fade content 1 out and fade content 2 in animation.
@HostListener('selectedTabChange', ['$event']) selectedTabChange(event: MatTabChangeEvent) {
console.log('Change Tab', event);
this.renderer.setStyle(event.tab.content.templateRef.elementRef.nativeElement, 'background-color', 'red');
}