Skip to content

Commit ee5e85c

Browse files
committed
Update breadcrumb skeleton
1 parent 41cb5be commit ee5e85c

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/breadcrumb/breadcrumb.component.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,26 @@ const MINIMUM_OVERFLOW_THRESHOLD = 4;
5656
</nav>`
5757
})
5858
export class Breadcrumb implements AfterContentInit {
59-
@ContentChildren(BreadcrumbItemComponent) childs: QueryList<BreadcrumbItemComponent>;
59+
@ContentChildren(BreadcrumbItemComponent) children: QueryList<BreadcrumbItemComponent>;
6060

6161
@Input() items: Array<BreadcrumbItem>;
6262

6363
@Input() noTrailingSlash = false;
6464

6565
@Input() ariaLabel: string;
6666

67-
@Input() skeleton = false;
68-
6967
protected _threshold: number;
68+
protected _skeleton = false;
69+
70+
@Input()
71+
set skeleton(value: any) {
72+
this._skeleton = value;
73+
this.updateChildren();
74+
}
75+
76+
get skeleton(): any {
77+
return this._skeleton;
78+
}
7079

7180
@Input()
7281
set threshold(threshold: number) {
@@ -81,7 +90,7 @@ export class Breadcrumb implements AfterContentInit {
8190
}
8291

8392
ngAfterContentInit() {
84-
this.childs.toArray().forEach(child => child.skeleton = this.skeleton);
93+
this.updateChildren();
8594
}
8695

8796
get shouldShowContent(): boolean {
@@ -110,4 +119,10 @@ export class Breadcrumb implements AfterContentInit {
110119
get last(): BreadcrumbItem {
111120
return this.shouldShowOverflow ? this.items[this.items.length - 1] : null;
112121
}
122+
123+
protected updateChildren() {
124+
if (this.children) {
125+
this.children.toArray().forEach(child => child.skeleton = this.skeleton);
126+
}
127+
}
113128
}

0 commit comments

Comments
 (0)