igniteui-angular
igniteui-angular copied to clipboard
Programatically change tab item
How can I change the active tab in a tabs component by code? The selectedIndex is read only, and I can't find any method for it in the IgxTabsComponent
You can select a tabs group using IgxTabsGroupComponent select() method. For example:
@ViewChild('selectedTabsGroup')
public selectedTabsGroup: IgxTabsGroupComponent;
public selectTabsGroup() {
this.selectedTabsGroup.select();
}
Ah, thank you. I would have thought it would be present on the container component, so there was no need to set up multiple viewchildren for the tabs, but thats ok.
I would suggest updating https://www.infragistics.com/products/ignite-ui-angular/angular/components/tabs.html with this as well then, as it doesn't seem to mention the select-method.