-
Notifications
You must be signed in to change notification settings - Fork 0
/
PENDING_CODE
45 lines (43 loc) · 1.56 KB
/
PENDING_CODE
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
import { Component } from '@angular/core';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatCardModule } from '@angular/material/card';
export interface Tile {
color: string;
cols: number;
rows: number;
text: string;
}
/**
* @title Dynamic grid-list
*/
@Component({
selector: 'grid-list-dynamic-example',
templateUrl: `
<mat-grid-list cols="4" rowHeight="200px" gutterSize="20px">
<mat-grid-tile-header>Hola! </mat-grid-tile-header>
@for (tile of tiles; track tile) {
<mat-grid-tile [colspan]="tile.cols" [rowspan]="tile.rows">
<mat-card>
<mat-card-header>
<mat-card-title>{{tile.text}} </mat-card-title>
</mat-card-header>
<img mat-card-lg-image src="https://image.tmdb.org/t/p/w500/gJtA7hYsBMQ7EM3sPBMUdBfU7a0.jpg" />
<mat-card-content> </mat-card-content>
</mat-card>
</mat-grid-tile>
}
</mat-grid-list>`,
imports: [MatGridListModule, MatCardModule],
})
export class GridListDynamicExample {
tiles: Tile[] = [
{ text: 'One', cols: 1, rows: 1, color: 'lightblue' },
{ text: 'Two', cols: 1, rows: 1, color: 'lightgreen' },
{ text: 'Three', cols: 1, rows: 1, color: 'lightpink' },
{ text: 'Four', cols: 1, rows: 1, color: '#DDBDF1' },
{ text: 'Five', cols: 1, rows: 1, color: 'lightblue' },
{ text: 'Six', cols: 1, rows: 1, color: 'lightgreen' },
{ text: 'Seven', cols: 1, rows: 1, color: 'lightpink' },
{ text: 'Eight', cols: 1, rows: 1, color: '#DDBDF1' },
];
}