2

我正在使用 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,而不是在 md-select 的实际父 div“my-select-div”下。

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

谢谢。

4

0 回答 0