2016-12-03 3 views
0

これは選択リストを埋めるためのコードです。私はブランドのユーザーが選択したいmd-selectからのselect itemの入手方法

<md-option ng-value="brand.name" ng-repeat="brand in brands">{{ brand.name }}</md-option> 
</md-select> 

は、スコープ変数selectedBrand

で利用可能であるべきである。しかし、それは未定義私を与えます。

上記のコードに問題がありますか?

答えて

0
<div layout="row"> 
    <md-select class="inline-flex md-select-down" placeholder="Select" ng-model="selectedBrand"> 
     <md-option ng-repeat="item in brands" value="{{item.name}}"> 
     {{item.name}} 
     </md-option> 
    </md-select> 
</div> 

DEMO

関連する問題