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', () => {
475
475
expect ( footer . nativeElement . classList . contains ( 'mat-2-line' ) ) . toBe ( true ) ;
476
476
} ) ;
477
477
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
+
478
486
it ( 'should not use calc() that evaluates to 0' , ( ) => {
479
487
const fixture = createComponent ( GirdListWithRowHeightRatio ) ;
480
488
@@ -784,6 +792,19 @@ class GridListWithFootersWithoutLines { }
784
792
</mat-grid-list>` } )
785
793
class GridListWithFooterContainingTwoLines { }
786
794
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
+
787
808
@Component ( { template : `
788
809
<mat-grid-list cols="5">
789
810
<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 {
70
70
encapsulation : ViewEncapsulation . None ,
71
71
} )
72
72
export class MatGridTileText implements AfterContentInit {
73
- @ContentChildren ( MatLine ) _lines : QueryList < MatLine > ;
73
+ @ContentChildren ( MatLine , { descendants : true } ) _lines : QueryList < MatLine > ;
74
74
75
75
constructor ( private _element : ElementRef < HTMLElement > ) { }
76
76
You can’t perform that action at this time.
0 commit comments