i created grid list with column 6 and i want to be grid title take 100% width on small screen devices. Now it creates 6 column on small screens as well
Expected: One gri
You have to set the cols
attribute of the mat-grid-list
dynamically depending on the screen width. You'd have to decide on which width breakpoint will the mat-grid-list
render the 1-column version.
HTML:
1
2
3
4
5
6
TS:
ngOnInit() {
this.breakpoint = (window.innerWidth <= 400) ? 1 : 6;
}
onResize(event) {
this.breakpoint = (event.target.innerWidth <= 400) ? 1 : 6;
}
Stackblitz demo here
Hope this helps!