I am facing an issue with accessing tabs within a nested component. The parent component contains the tab feature and to reach the tabs inside the child component, I am using the following code:
document.querySelectorAll('.mat-tab-group');
The above code returns an array of length 2 due to another tab. To set the default tab as the last one, I use the following code:
const tabs = document.querySelectorAll('.mat-tab-group');
if (tabs.length > 0) {
tabs[tabs.length - 1]['selectedIndex'] = 3;
}
However, this doesn't seem to have any effect. I would appreciate any assistance on this matter. Thank you.
Note: I am unable to modify the parent component, only the inner one.