我在设置
ng-model
用于选择下拉列表。
ng模型
ng-options
总是以
null
.
这是获取订单的方法:
orderService.getMerchantOrders(qs)
.then(
function (response) {
$scope.isLoading = false;
$scope.pagerService = new pagerService({
page: $scope.pagerService.page,
data: response.data.items,
total: response.data.total,
sortVars: response.data.sort,
pageSize: 5
});
},
function (error) {
if (error.status === 401) {
$window.location.href = $scope.returnUrl;
} else {
console.log(error);
}
});
这是pagerService的功能。数据如下所示:
order.orderShippingMethod[0].shippingMethod
是:
{"shippingMethodId":7,"carrierName":"Russian Post","carrierUrl":"http://www.russianpost.ru/tracking20/English.htm","orderShippingMethod":[]}
谢谢你的建议。我对
AngularJs公司
所以我觉得这很简单,我在这里错过了!
<select class="form-control" name="carrierList"
ng-model="order.orderShippingMethod[0].shippingMethod"
ng-options="shippingMethod.shippingMethodId as shippingMethod.carrierName
for shippingMethod in shippingMethods" required>
<option value="">Select Carrier</option>
</select>