角度は、あなたの質問に答える美しい例があります。次に、内側にmd-grid-tile
のコンポーネントのリストを入力します(角度使用の例ではngFor
が使用されます)。
あなたは行列5v7を構築したいのであれば、その後、試してみてください。
<md-grid-list cols="7" rowHeight="100px">
<md-grid-tile
*ngFor="let tile of tiles"
[colspan]="tile.cols"
[rowspan]="tile.rows"
[style.background]="tile.color">
{{tile.text}}
</md-grid-tile>
</md-grid-list>
と
@Component({
selector: 'grid-list-dynamic-example',
templateUrl: 'grid-list-dynamic-example.html',
})
export class GridListDynamicExample {
tiles = [
{text: 'One', cols: 1, rows: 1, color: 'lightblue'},
{text: 'Two', cols: 1, rows: 1, color: 'lightblue'},
{text: 'etc', cols: 1, rows: 1, color: 'lightblue'},
{text: 'etc', cols: 1, rows: 1, color: 'lightblue'},
{text: 'etc', cols: 1, rows: 1, color: 'lightblue'},
{text: 'etc', cols: 1, rows: 1, color: 'lightblue'},
{text: 'etc', cols: 1, rows: 1, color: 'lightblue'},
{text: '...', cols: 1, rows: 1, color: 'lightblue'},
];
}
だから、それは良い例ではないが、この例に基づいて、私は、質問をし、それが明確でないため – Daniel
'のCOLS =「4」'が、私は、私は理解しない3 – Daniel
を参照してくださいどのように行列を構築する5x7 – Daniel