我正在使用离子选择框。
http://codepen.io/mhartington/pen/CImqy?editors=101
$(function() {}
我将ng-model添加到<fancy-select header-text="Single" allow-empty='false' value="val.single" text="title_text_single" items="title">
</fancy-select>
<script id="fancy-select.html" type="text/ng-template">
<ion-list>
<ion-item class="item-text-wrap" ng-click="showItems($event)" ng-model="personalDetailsObj.personalDetails.title">
{{text}}
<span class="item-note">
{{noteText}}
</span>
</ion-item>
</ion-list>
</script>
,但我无法获得该值。
答案 0 :(得分:0)
尝试将fancy-select的value属性更改为“personalDetailsObj.personalDetails.title”
<fancy-select header-text="Single" allow-empty='false' value="personalDetailsObj.personalDetails.title" text="title_text_single" items="title">
</fancy-select>
<script id="fancy-select.html" type="text/ng-template">
<ion-list>
<ion-item class="item-text-wrap" ng-click="showItems($event)">
{{text}}
<span class="item-note">
{{noteText}}
</span>
</ion-item>
</ion-list>
希望它有所帮助。