forked from NG-ZORRO/ng-zorro-antd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
breadcrumb-item.component.ts
46 lines (39 loc) 路 1.48 KB
/
breadcrumb-item.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
import { NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown';
import { NzBreadcrumb } from './breadcrumb';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'nz-breadcrumb-item',
exportAs: 'nzBreadcrumbItem',
preserveWhitespaces: false,
template: `
<ng-container *ngIf="!!nzOverlay; else noMenuTpl">
<span class="ant-breadcrumb-overlay-link" nz-dropdown [nzDropdownMenu]="nzOverlay">
<ng-template [ngTemplateOutlet]="noMenuTpl"></ng-template>
<span *ngIf="!!nzOverlay" nz-icon nzType="down"></span>
</span>
</ng-container>
<ng-template #noMenuTpl>
<span class="ant-breadcrumb-link">
<ng-content></ng-content>
</span>
</ng-template>
<span class="ant-breadcrumb-separator" *ngIf="nzBreadCrumbComponent.nzSeparator">
<ng-container *nzStringTemplateOutlet="nzBreadCrumbComponent.nzSeparator">
{{ nzBreadCrumbComponent.nzSeparator }}
</ng-container>
</span>
`
})
export class NzBreadCrumbItemComponent {
/**
* Dropdown content of a breadcrumb item.
*/
@Input() nzOverlay?: NzDropdownMenuComponent;
constructor(public nzBreadCrumbComponent: NzBreadcrumb) {}
}