离子选项选择不在第二级工作

时间:2016-06-24 10:09:52

标签: angularjs ionic-framework

我的json

{
"product_id": "50",
"thumb": "",
"name": "AASHIRVAAD ATTA",
"price": "Rs.170.00",
"price_only": "170.0000",
"special": "Rs.160.00",
"minimum": "2",
"minimum_app_qty": 1,
"product_unit": "kg",
"qty": "10000",
"weight": 5,
"options": [{
    "product_id": "50",
    "product_option_id": "228",
    "option_id": "13",
    "product_option_value": [{
        "name": "10kg",
        "image": null,
        "price": "Rs.340.00",
        "price_only": 340
    }, {
        "name": "2kg",
        "image": null,
        "price": "Rs.71.00",
        "price_only": 71
    }]
}]}

我想在离子

中添加选择选项

productlist.html

     <select class="item item-input item-select item-balanced" style="padding: 4px 10px 4px 0; font-size: 12px; margin-top: 4px; width: 34%;height: 30px; float: left;" ng-show="item.options==''">
             <option value="{{item.weight}}{{item.product_unit}}" >{{item.weight}}{{item.product_unit}}</option>
        </select>

        <select class="item item-input item-select item-balanced" style="padding: 4px 10px 4px 0; font-size: 12px; margin-top: 4px; width: 34%;height: 30px; float: left;" ng-repeat="opt in item.options" ng-show="item.options!=''">
             <option ng-repeat="opvalue in opt.product_option_value" >{{opvalue.name}}</option>
        </select>

它工作正常,但我想在select选项中添加ng-change事件并获得选定的值运行时间

我尝试使用代码但不能正常工作

 <select class="item item-input item-select item-balanced" 
                ng-if="item.options.product_option_value.length > 1" 
                ng-model="item.options.selectedItem"
                ng-options="opt.name for opt in item.options.product_option_value">
            </select>

0 个答案:

没有答案