Skip to content

Commit

Permalink
#52: Tab-Panel wird an Header übergeben
Browse files Browse the repository at this point in the history
- Router Outlet muss als TabPanel angegeben werden
  • Loading branch information
Hirschfuchs committed Dec 20, 2023
1 parent 9a48da8 commit 6b58c54
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<header>
<app-header></app-header>
<app-header [tabPanel]="tabPanel"></app-header>
</header>

<h1>Buntnis Ilmenau</h1>
<h2>Für Demokratie und Weltoffenheit</h2>

<router-outlet />
<router-outlet #tabPanel />
2 changes: 1 addition & 1 deletion src/app/shared/components/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mat-toolbar>
<span>LOGO (folgt)</span>
<nav mat-tab-nav-bar>
<nav mat-tab-nav-bar [tabPanel]="tabPanel">
@for (buntnispage of mainpages; track buntnispage) {
<a
mat-tab-link
Expand Down
6 changes: 5 additions & 1 deletion src/app/shared/components/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Component, Input } from '@angular/core';
import { MatTabNavPanel } from '@angular/material/tabs';
import { pages } from '../../types/pages';

@Component({
Expand All @@ -8,4 +9,7 @@ import { pages } from '../../types/pages';
})
export class HeaderComponent {
mainpages = pages;

@Input()
tabPanel: MatTabNavPanel | undefined;
}

0 comments on commit 6b58c54

Please sign in to comment.