@angular/material/tabs#MatTabChangeEvent TypeScript Examples

The following examples show how to use @angular/material/tabs#MatTabChangeEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: content.component.ts    From open-source with MIT License 6 votes vote down vote up
onTabChange({ index, tab }: MatTabChangeEvent): void {
    // update the URL
    this.router.navigate(
      [],
      {
        relativeTo: this.route,
        queryParams: index !== 0
          ? { active: tab.textLabel.toLowerCase() } // FIXME update i18n
          : {},
      });

    if (tab.textLabel === 'Examples') { // FIXME update i18n
      this.loadExamples = true;
    }
  }
Example #2
Source File: home.component.ts    From VIR with MIT License 5 votes vote down vote up
onSelectedTabChange(event: MatTabChangeEvent) {
    this.onSelectedIndexChange(event.index)
  }
Example #3
Source File: addon-detail.component.ts    From WowUp with GNU General Public License v3.0 5 votes vote down vote up
public async onSelectedTabChange(evt: MatTabChangeEvent): Promise<void> {
    await this._sessionService.setSelectedDetailsTab(this.getSelectedTabTypeFromIndex(evt.index));
  }
Example #4
Source File: add-torrent-dialog.component.ts    From qbit-matUI with MIT License 5 votes vote down vote up
handleTabChange(event: MatTabChangeEvent) {
    event.index === 0 ? this.setDialogPosition() : this.resetDialogPosition();
    this.currentTab = event;
  }
Example #5
Source File: add-torrent-dialog.component.ts    From qbit-matUI with MIT License 5 votes vote down vote up
/** Keep track of the mat-tab the user is currently in. */
  public currentTab: MatTabChangeEvent;
Example #6
Source File: tabs.component.ts    From loopback4-microservice-catalog with MIT License 5 votes vote down vote up
tabChanged(tabChangeEvent: MatTabChangeEvent) {
    this.tabChangeEvent.emit(tabChangeEvent.index);
  }