title: Goto another tab from a particular tab on Click event using Angular4 (Primeng datatable)
body: <p>I am using Angular4 to create an application in which i need to navigate between tabs using a button click event inside the tabs.Primeng Datatable click event navigate to another tab.</p>
  
  <p><strong>tabsSample.html</strong>  </p>
  
  <pre><code>&lt;md-tab-group class="custom-tab helper-top-margin" (selectedIndexChange)="selectedIndexChange($event)" [selectedIndex]="selectedIndex"&gt;
      &lt;md-tab&gt;
          &lt;tab1&gt;&lt;/tab1&gt;
      &lt;/md-tab&gt;
      &lt;md-tab&gt;
          &lt;span&gt;
              &lt;p-tabView orientation="left" class="custom-vertical-tab"&gt;
                  &lt;p-tabPanel header="Tab 2" [selected]="true"&gt;
                      &lt;tab2&gt;&lt;/tab2&gt;
                  &lt;/p-tabPanel&gt;
                  &lt;p-tabPanel header="Tab 3"&gt;
                      &lt;tab3&gt;&lt;/tab3&gt;
                  &lt;/p-tabPanel&gt; 
              &lt;/p-tabView&gt;
          &lt;/span&gt;
      &lt;/md-tab&gt;
  &lt;/md-tab-group&gt;
  </code></pre>
  
  <p><strong>Component</strong></p>
  
  <pre><code>@Component({
      selector: 'tabs-sample',
      templateUrl: './tabsSample.html',
  })
  export class TabsSample {
      selectedIndex: number = 0;
  
  }
  </code></pre>
  
  <p>tab1.html</p>
  
  <pre><code>&lt;p-dataTable [value]="cars" selectionMode="single" [responsive]="true" class="fixed-datatable-width small-text"&gt;
      &lt;p-column header=""&gt;
          &lt;ng-template let-car="rowData" pTemplate="body"&gt;
              &lt;a (click)="clickMe(car)" md-suffix class="helper-search-icon datatable-primary-icon"&gt;
                  &lt;md-icon&gt;search&lt;/md-icon&gt;
              &lt;/a&gt;
          &lt;/ng-template&gt;
      &lt;/p-column&gt;
  &lt;/p-dataTable&gt;
  
  @Component({
    selector: 'tab1',
    templateUrl: './tab1.html',
  })
  export class Tab1 {
    cars: Car[];
  
      constructor(private carService: CarService) { }
  
      ngOnInit() {
          this.carService.getCarsSmall().then(cars =&gt; this.cars = cars);
      }
  
    clickMe(event: any){
      this.selectedIndex=event;
    }
  
  }
  </code></pre>