Skip to content

not able to use ng-container within mat-grid-list #12809

Closed
@tbnovaes

Description

@tbnovaes

Bug, feature request, or proposal:

Allow ng-container to work inside mat-grid-list

What is the expected behavior?

Being able to use ng-container inside mat-list-grid, so it would allow to have ngSwitch or *ngFor doing some logic before creating the item.

What is the current behavior?

If you try to add ng-container nothing is rendered.

What are the steps to reproduce?

1 - Create a mat-grid-list
2 - Add ng-container with ngFor or ngSwitch
3 - Add the mat-grid-tile, and nothing is rendered

https://stackblitz.com/edit/angular-material2-issue-8vvb8z

What is the use-case or motivation for changing an existing behavior?

Being able to generate a dashboard dynamically based on the type of component you need to load, and use breakpointObserver to define the number of columns based on the type of the widget.

For example:
widget 1 loads a map
widget 2 loads a random number of charts, where it chart should be a tile

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 6.1.2
Angular Material 6.4.5
macOS 10.13.6
Typescript 2.9.2
All Browsers

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions