title: How do you get the selected tab from a bootstrap tabset in Angular4?
body: <p>I have a set of tabs that I create dynamically, dependent on my input data. And what I want to do is to be able to figure out which tab is currently selected. In the example code below, I have a tab control and beneath all this, I have a button that when clicked will delete the selected tab. I've tried to keep this relatively simple and it might seem contrived, but I hope it does to illustrate what I mean.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;div class="col-md-12"&gt;
    &lt;ngb-tabset *ngIf="selectedInfo" type="groups" &gt;
      &lt;ngb-tab *ngFor="let tab of selectedInfo.groups" title={{tab.name}} &gt;
          // some stuff in the tabs
      &lt;/ngb-tab&gt;
    &lt;/ngb-tabset&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
    &lt;button class="btn btn-primary float-left" (click)="deleteTab()" &gt; Delete Tab &lt;/button&gt;
  &lt;/div&gt;
  
  
  export class MyTabs implements OnInit {
  
    selectedIfno: MyInfoClass;
  
    ngOnInit(): void {
  
      // init data
  
    }
  
    deleteTab() {
  
  
    }
  
  }
  </code></pre>
  
  <p>So let's say I want to delete the currently selected tab. How do I know what tab is currently selected?</p>