@angular/material/tabs#MatTab TypeScript Examples
The following examples show how to use
@angular/material/tabs#MatTab.
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: dxc-tabs.component.ts From halstack-angular with Apache License 2.0 | 6 votes |
public ngAfterViewInit() {
this.generateTabs();
this.className = `${this.getDynamicStyle(this.defaultInputs.getValue())}`;
this.insertUnderline();
this.cdRef.detectChanges();
this.setEventListeners();
this.cdRef.detectChanges();
this.tabs.changes.subscribe((value) => {
const matTabsFromQueryList = value.map((tab, index) => {
if (tab.label && tab.iconSrc) {
this.allTabWithLabelAndIcon = true;
}
tab.id = index;
return tab.matTab;
});
const list = new QueryList<MatTab>();
list.reset([matTabsFromQueryList]);
this.tabGroup._tabs = list;
this.setActiveTab();
this.cdRef.detectChanges();
});
}
Example #2
Source File: dxc-tabs.component.ts From halstack-angular with Apache License 2.0 | 6 votes |
private generateTabs() {
const matTabsFromQueryList = this.tabs.map((tab, index) => {
if (tab.label && tab.iconSrc) {
this.allTabWithLabelAndIcon = true;
}
tab.id = index;
return tab.matTab;
});
const list = new QueryList<MatTab>();
list.reset([matTabsFromQueryList]);
this.tabGroup._tabs = list;
this.setActiveTab();
}
Example #3
Source File: dxc-tabs.module.ts From halstack-angular with Apache License 2.0 | 6 votes |
@NgModule({
declarations: [DxcTabsComponent, DxcTabComponent, DxcTabIconComponent],
imports: [
CommonModule,
MatInputModule,
MatTabsModule,
MatFormFieldModule,
DxcBadgeModule,
FormsModule,
],
exports: [DxcTabsComponent, DxcTabComponent, DxcTabIconComponent],
entryComponents: [MatTab, MatTabGroup],
})
export class DxcTabsModule {}
Example #4
Source File: dxc-tab.component.ts From halstack-angular with Apache License 2.0 | 5 votes |
@ViewChild(MatTab, { static: false })
public matTab: MatTab;
Example #5
Source File: workflow-list.component.ts From workflow-editor with Educational Community License v2.0 | 5 votes |
@ViewChildren(MatTab, {read: MatTab})
public tabNodes: QueryList<MatTab>;