AngularJS材质 - 为<md-option>设置父div

时间:2018-04-12 06:17:47

标签: angularjs html5 css3 angularjs-material md-select

我正在使用AngularJS材料1.1.8。我有一个带md-option的md-select元素,它使用ng-repeat来填充列表项:

<body>
    <div>
      <div id="my-select-div" layout="row" layout-align="space-between center">
         <md-select placeholder="Select Item" class="md-no-underline"
         md-container-class="my-md-select-dropdown">
             <md-option ng-repeat="item in $ctrl.items" ng-value="item">
                     <header>{{ item.name }}</header>
             </md-option> 
         </md-select>
     </div>
  </div>
</body>

当按下md-select时,Angular会为body元素下的md-options创建一个新的div,而不是在div“my-select-div”下面,它是md-select的实际父级。

如何将md-option的div的父级设置为“my-select-div”?

感谢。

0 个答案:

没有答案