Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Material -md-grid-list content

I am trying to use md-grid-tile of angular material.The Issue I am facing is content of md-grid-tile is aligned center.How to make to work it from Start

    <md-content layout-padding> 

         <md-grid-list md-cols="6"
            md-row-height-gt-md="1:1" md-row-height="4:3" md-gutter-gt-md="16px"
            md-gutter-gt-sm="8px" md-gutter="4px"> 
                    <md-grid-tile
                    ng-repeat="room in floorDetails.roomDetails"
                    ng-style="{'background': '#f2f2f2'}"
                    md-colspan-gt-sm="3"
                    md-rowspan-gt-sm="2">  



                                <div layout="row"  layout-align="center center">
                                <b >Room1</b>
                                </div>
                                 <div class='md-padding' layout="row" layout-wrap>
                                         <md-card class="md-card" ng-repeat="bed in room.bedIds">
                                             <md-card-content>

                                             </md-card-content>
                                         </md-card>
                                     </div>
                             </div>
              </md-grid-tile>        
      </md-grid-list>  

Current snap

Current snap

Desired snap

desired snap

like image 392
rupesh_padhye Avatar asked Jan 13 '16 12:01

rupesh_padhye


People also ask

Can Angular use material UI?

Material UI and Angular Material are both implementation of google material design. But Material UI is for react, while Angular Material is for Angular. Show activity on this post. Since Material Design Lite does not have any dependency, it's going to be easy to set up.

What is material component?

Material Components are interactive building blocks for creating a user interface. Browse all components or select a specific platform. All Components Android Web Flutter iOS.

Which features provided by Angular material?

Angular Material provides a set of reusable UI components based on the Material Design system. Angular Material is composed of several pieces. It has a CSS library for typography and other elements, it provides an interesting JavaScript approach for theming, and its responsive layout uses a flex grid.


1 Answers

Try to provide a codepen/plunkr with an example next time, people are more inclined to help you if they have sample code to play around with.

You should read up on angular-material layout. You are mainly missing a <div layout="column" layout-fill> container inside of your md-grid-tile. The layout-fill makes the container fill the whole tile.

You can then adjust the size of your cards with fixed css sizes or flex them. The example flexes them horizontally which may not be desired.

codepen

like image 91
kuhnroyal Avatar answered Oct 17 '22 19:10

kuhnroyal