Topic: Override method ngOnDestroy TabDirective

CarouselAnim free asked 3 years ago


I use the mdb-pro library and in particular the TabSetComponent. I have a problem with the ngondestroy function of TabDirective. This one realizes : this.tabset.removeTab(this); I would like to know if there is a way to override the ngondestroy function of the TabDirective to prevent the tab from being removed. Thanks


Arkadiusz Idzikowski staff commented 3 years ago

@CarouselAnim We don't recommend overriding the component original code. Can you provide more information about the problem? Maybe we will be able to modify the code in order to resolve it.


CarouselAnim free commented 3 years ago

Thanks for your answer. The method is called when in fact the whole tabset is going to be destroyed but here what happens with this method is that my 2nd tabset becomes active instead, and this is not the desired behaviour. Indeed, on my 2 tabs, there is a list of items and when you click on one of them you are redirected to another page. There is an enter/leave animation with the next page but because of this ngondestroy method, it happens the following effect: click on an element of the list of the tab 1, the tab is destroyed, the second tab becomes active and animation with the second tab instead of the first tab.


Arkadiusz Idzikowski staff commented 3 years ago

@CarouselAnim Can you edit your first post and add an example HTML/TS code on which we will be able to reproduce the problem?



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB4 10.1.1
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No