Skip to content

Commit

Permalink
update menubar router doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed May 14, 2024
1 parent 81a2305 commit f6dccbc
Showing 1 changed file with 30 additions and 9 deletions.
39 changes: 30 additions & 9 deletions src/app/showcase/doc/menubar/routerdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,25 @@ import { Router } from '@angular/router';
<div class="card">
<p-menubar [model]="items">
<ng-template pTemplate="item" let-item>
<ng-container *ngIf="item.route; else elseBlock">
<ng-container *ngIf="item.route; else urlRef">
<a [routerLink]="item.route" class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
</a>
</ng-container>
<ng-template #elseBlock>
<a [href]="item.url" class="p-menuitem-link">
<ng-template #urlRef>
<a *ngIf="item.url; else noLink" [href]="item.url" class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
</a>
</ng-template>
<ng-template #noLink>
<div class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
<span class="pi pi-fw pi-angle-down ml-2"></span>
</div>
</ng-template>
</ng-template>
</p-menubar>
</div>
Expand Down Expand Up @@ -78,36 +85,50 @@ export class RouterDoc implements OnInit {
code: Code = {
basic: `<p-menubar [model]="items">
<ng-template pTemplate="item" let-item>
<ng-container *ngIf="item.route; else elseBlock">
<ng-container *ngIf="item.route; else urlRef">
<a [routerLink]="item.route" class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
</a>
</ng-container>
<ng-template #elseBlock>
<a [href]="item.url" class="p-menuitem-link">
<ng-template #urlRef>
<a *ngIf="item.url; else noLink" [href]="item.url" class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
</a>
</ng-template>
<ng-template #noLink>
<div class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
<span class="pi pi-fw pi-angle-down ml-2"></span>
</div>
</ng-template>
</ng-template>
</p-menubar>`,

html: `<div class="card">
<p-menubar [model]="items">
<ng-template pTemplate="item" let-item>
<ng-container *ngIf="item.route; else elseBlock">
<ng-container *ngIf="item.route; else urlRef">
<a [routerLink]="item.route" class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
</a>
</ng-container>
<ng-template #elseBlock>
<a [href]="item.url" class="p-menuitem-link">
<ng-template #urlRef>
<a *ngIf="item.url; else noLink" [href]="item.url" class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
</a>
</ng-template>
<ng-template #noLink>
<div class="p-menuitem-link">
<span [class]="item.icon"></span>
<span class="ml-2">{{ item.label }}</span>
<span class="pi pi-fw pi-angle-down ml-2"></span>
</div>
</ng-template>
</ng-template>
</p-menubar>
</div>`,
Expand Down

0 comments on commit f6dccbc

Please sign in to comment.