[英]Ionic search popup with JSON value
使用Popup進行離子搜索。 它正在努力
$scope.selectables = [
1, 2, 3 ];
但是我想讓它在json上工作
$scope.countries = [
{id: 1, text: 'USA', checked: false, icon: null},
{id: 2, text: 'France', checked: false, icon: null},
{id : 3, text: 'Japan', checked: true, icon: null}];
當我點擊選擇它按鈕然后綁定值美國,法國,日本。 我不想在Array中推送值。
我正在使用的代碼可以在codepen.io上的下一個鏈接上找到:
將您的選項options="selectables"
更改為options="countries"
並將其打印為option.text
以顯示國家/地區名稱,這里是工作的plunker檢查它
<div class="item item-body">
<button class="button button-positive" modal-select="" ng-model="someModel" options="countries" modal-title="Select " has-search="true">
{{someModel.text}}
<div class="option">
{{option.text}}
</div>
</button>
<div class="item">
someModel: {{someModel.text}}
</div>
</div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.