Topic: MdbTabsComponent setActiveTab not working
tech
pro
asked 1 year ago
I am using angular mdbtabs with latest version 5.
I am generating the tabs using nfFor as the tabs are dynamic. The active tab is not set ever after i am setting on the ts file
ngOnInit(): void {
this.tabs.tabs.first.active = true
this.tabs.setActiveTab(1)
} ngAfterViewInit(): void { this.tabs.tabs.first.active = true this.tabs.setActiveTab(1) }
Arkadiusz Idzikowski
staff
answered 1 year ago
Please try to use this code as a workaround for now, we will take a closer look at that to check if we can change something in the component code to fix that:
ngAfterViewInit() {
Promise.resolve().then(() => {
this.tabs.setActiveTab(1);
});
}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: MDB5 2.0.0
- Device: PC
- Browser: chrome
- OS: Windowns
- Provided sample code: No
- Provided link: No