Closed sudha-tup closed 7 years ago
Please provide plunkr/stackblitz with reproduction You can use one of starter templates: Plunkr: https://plnkr.co/edit/0NipkZrnckZZROAcnjzB?p=preview StackBlitz: https://stackblitz.com/edit/ngx-bootstrap?file=app%2Fapp.module.ts
https://plnkr.co/edit/xQ3BJOXCwzhEa4LmQ4rW?p=preview - I created a little reproduction of your issue and it's clear to me that this is supposed to be this way, because when you extend a component, you copy all methods and properties. So when you click on set tab
button in your child component, you're actually changing tabs
property of child component, not the one it was extended from.
I am trying to switch tabs in AppComponent from a button in a class inheriting AppComponent. I see that the setTab method is being executed when the button is clicked and the tabs array is being modified. But the tabs don't switch. Any thoughts?
app.component.ts:
app.component.html
accounts.component.html
Don't have any code in AccountsComponent, but it extends AppComponent, so that the setTab method is available.
I just installed "bootstrap": "^3.3.7", "ng2-bootstrap": "^1.6.3" on top of default packages which were installed by cli. Followed instructions in https://github.com/valor-software/ngx-bootstrap/blob/development/docs/getting-started/bootstrap4.md. Also, if I move the button to the AppComponent from the child component, I dont have any problem in controlling the tabs, and it works fine.