File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -56,17 +56,26 @@ const MINIMUM_OVERFLOW_THRESHOLD = 4;
5656 </nav>`
5757} )
5858export 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}
You can’t perform that action at this time.
0 commit comments