vlio20
vlio20

Reputation: 9295

AngularJS material layout - issues with flex

I have a problem setting the flex properties of my layout. Here is a plunker: http://embed.plnkr.co/0SrUp25FvT2PAsJDEwF3/preview

  <md-content flex layout="row" layout-align="center">
    <div layout="column">
      <div flex layout="column" layout-fill>
        <div flex="33">
          <md-input-container>
            <label>Enter Room's Name</label>
            <input ng-model="test" placeholder="Enter Room's Name">
          </md-input-container>
        </div>
        <div flex="66">
          <md-button class="md-raised md-accent">
            Create Chat Room
          </md-button>
        </div>
      </div>
    </div>
  </md-content>

Here is the link to documentation: https://material.angularjs.org/#/layout/grid

The issue that the flex property of the input (text) and input (button) are not obeying the flex attribute.

What I am trying to achieve is something like that: enter image description here

Upvotes: 5

Views: 23077

Answers (1)

dsteve
dsteve

Reputation: 201

here is the result after I tried it,

hopefully it helps:

<md-content layout="row" layout-align="center">
  <div layout="column">
    <div flex layout="column" layout-fill> <!-- this is what I change -->
      <div flex="33">
        <md-input-container>
          <label>Enter Room's Name</label>
          <input ng-model="test" placeholder="Enter Room's Name">
        </md-input-container>
      </div>
      <div flex="66">
        <md-button class="md-raised md-accent">
          Create Chat Room
        </md-button>
      </div>
    </div>
  </div>

</md-content>

Upvotes: 11

Related Questions