File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -475,6 +475,14 @@ describe('MatGridList', () => {
475475 expect ( footer . nativeElement . classList . contains ( 'mat-2-line' ) ) . toBe ( true ) ;
476476 } ) ;
477477
478+ it ( 'should add class to footers with two indirect descendant lines' , ( ) => {
479+ const fixture = createComponent ( GridListWithFooterContainingTwoIndirectDescendantLines ) ;
480+ fixture . detectChanges ( ) ;
481+
482+ const footer = fixture . debugElement . query ( By . directive ( MatGridTileText ) ) ! ;
483+ expect ( footer . nativeElement . classList ) . toContain ( 'mat-2-line' ) ;
484+ } ) ;
485+
478486 it ( 'should not use calc() that evaluates to 0' , ( ) => {
479487 const fixture = createComponent ( GirdListWithRowHeightRatio ) ;
480488
@@ -784,6 +792,19 @@ class GridListWithFootersWithoutLines { }
784792 </mat-grid-list>` } )
785793class GridListWithFooterContainingTwoLines { }
786794
795+ @Component ( { template : `
796+ <mat-grid-list cols="1">
797+ <mat-grid-tile>
798+ <mat-grid-tile-footer>
799+ <ng-container [ngSwitch]="true">
800+ <h3 mat-line>First line</h3>
801+ <span mat-line>Second line</span>
802+ </ng-container>
803+ </mat-grid-tile-footer>
804+ </mat-grid-tile>
805+ </mat-grid-list>` } )
806+ class GridListWithFooterContainingTwoIndirectDescendantLines { }
807+
787808@Component ( { template : `
788809 <mat-grid-list cols="5">
789810 <mat-grid-tile [rowspan]="1" [colspan]="3">1</mat-grid-tile>
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export class MatGridTile {
7070 encapsulation : ViewEncapsulation . None ,
7171} )
7272export class MatGridTileText implements AfterContentInit {
73- @ContentChildren ( MatLine ) _lines : QueryList < MatLine > ;
73+ @ContentChildren ( MatLine , { descendants : true } ) _lines : QueryList < MatLine > ;
7474
7575 constructor ( private _element : ElementRef < HTMLElement > ) { }
7676
You can’t perform that action at this time.
0 commit comments