fxLayout ="排" @ angular / flex-layout":" 2.0.0-beta.1"和角材料2

时间:2017-08-10 20:15:05

标签: angular angular-material2 angular-flex-layout

<p class="normal-gray-txt text-center">
  <b>
    Choose reference
    architecture
  </b>
</p>
<form[formGroup=""]="custAppDetail" (ngSubmit=""
fxLayout="column" >
  <div fxLayout = "row" >
    <label fxFlex="1 6 60%"> Architecture file source</label>
    <md-select fxFlex = "3 1 40%" placeholder="abc"
      formControlName="archFileSource" (ngModelChange="")="toNeoGit($event)">
      <md-option* ngFor = "let env of archFileSrc"[value=""] = "env.value" >
        {{ env.viewValue }}
      </md-option>
    </md-select>
  </div>
  <div fxLayout = "row" >
    <label fxFlex="1 6 60%"> Architecture file</label>
    <md-select fxFlex = "3 1 40%" placeholder= "Choose file" formControlName= "archFile" >    
      <md - option * ngFor = "let env of ar"[value] = "env.value" >
         { { env.viewValue } }
      </md-option>
    </md-select>
  </div>
  <div fxLayout = "row" >
    <label fxFlex="1 6 60%"> Name</label>
    <md-input fxFlex = "3 1 40%" type="text" placeholder="Enter Name"
     formControlName="name">
    </md-input>
  </div>
  <div fxLayout = "row" >
    <label fxFlex="1 6 60%"> Cloud</label>
    <md-select fxFlex = "3 1 40%" placeholder="Choose Chain"
     formControlName="chaintype" (ngModelChange="")="toEnv($event)">
      <md-option* ngFor = "let env of cl"[value=""] = "env.value" >
        {{ env.viewValue }}
      </md-option>
    </md-select>
  </div>
  <div fxLayout = "row" >
    <label fxFlex="1 6 60%"> Enviroment</label>
    <md-select fxFlex = "3 1 40%" placeholder="Choose Environment"
      formControlName="selEnv">
      <md-option* ngFor = "let env of enviroment"[value=""] = "env.value" >
        {{ env.viewValue }}
      </md-option>
    </md-select>
  </div>
  <div class="box-btn-dialog" [hidden=""]="ftUser">
    <button md-raised-button="" class="auto-btn-prime"
      disabled=""]="!custAppDetail.valid" type="submit">LAUNCH</button>
    <button md-raised-button="" class="auto-btn-gray" md-dialog-close="cancel"
     type="button">CANCEL</button>
  </div>
</form>

对于第一行fxLayout =&#34; row&#34;虽然工作但不是剩下的4行,我希望其余的行能够呈现为第一行呈现任何帮助,我将使用&#34; @ angular / core&#34;:&#34; ^ 2.4.3&#34;,&#34; @ angular / flex-layout&#34;:&#34; 2.0.0-beta.1&#34;, 并且md-select的高度与md-input不同,ll的高度如何可以相同

1 个答案:

答案 0 :(得分:1)

正如我在评论中提到的,您的html中有很多错误的代码,例如data* ngFormd-raised-button=""[hidden=""]="ftUser"。一旦你清理完这些东西,代码似乎工作正常。

HTML:

disabled=""]="!custAppDetail.valid"

Plunker demo

要修复输入行高问题,请在组件的样式表中添加这些css。

<p class="normal-gray-txt text-center">
  <b>
    Choose reference
    architecture
  </b>
</p>
<form fxLayout="column" >
  <div fxLayout = "row" class="row-height">
    <label fxFlex="1 6 60%"> Architecture file source</label>
    <md-select fxFlex = "3 1 40%" placeholder="abc">
      <md-option *ngFor = "let env of [1, 2, 3, 4]" >
        {{ env }}
      </md-option>
    </md-select>
  </div>
  <div fxLayout = "row" class="row-height">
    <label fxFlex="1 6 60%"> Architecture file</label>
    <md-select fxFlex = "3 1 40%" placeholder= "Choose file">    
      <md-option *ngFor = "let env of [1, 2, 3, 4]" >
        {{ env }}
      </md-option>
    </md-select>
  </div>
  <div fxLayout = "row" class="row-height">
    <label fxFlex="1 6 60%"> Name</label>
    <md-input fxFlex = "3 1 40%" placeholder="Enter Name">
    </md-input>
  </div>
  <div fxLayout = "row" class="row-height">
    <label fxFlex="1 6 60%"> Cloud</label>
    <md-select fxFlex = "3 1 40%" placeholder="Choose Chain">
      <md-option *ngFor = "let env of [1, 2, 3, 4]" >
        {{ env }}
      </md-option>
    </md-select>
  </div>
  <div fxLayout = "row" class="row-height">
    <label fxFlex="1 6 60%"> Enviroment</label>
    <md-select fxFlex = "3 1 40%" placeholder="Choose Environment">
      <md-option *ngFor = "let env of [1, 2, 3, 4]" >
        {{ env }}
      </md-option>
    </md-select>
  </div>
  <div class="box-btn-dialog">
    <button md-raised-button class="auto-btn-prime">LAUNCH</button>
    <button md-raised-button class="auto-btn-gray">CANCEL</button>
  </div>
</form>