用戶應該在表單環境中選擇他們想要的產品。每種產品都有核心價格和多種其他選項可供選擇時更改價格。
產品和選項都顯示在兩個選擇字段被越來越填充像這樣:
$scope.products = [
{
name:'Product A',
cost:5,
options: [{name:"Option 1", value:10}]
},
{
name:'Product B',
cost:10,
options: [{name:"Option 1", value:10},{name:"Option 2", value:15}]
}
];
$scope.cart = {
items: [{
qty: 1,
}]
};
和
<tr ng:repeat="item in cart.items">
<td>
<div class="type-select">
<select ng-model="item.product" ng-options="p.name for p in products"></select>
</div>
</td>
<td>
<div class="type-select">
<select ng-model="item.option" ng-options="o for o in item.product.options.name" ng- disabled="!checked">
</div>
</td>
<td>
<input ng:model="item.qty" value="1" size="4" ng:required="" ng:validate="integer" class="ng-pristine ng-valid ng-valid-required input-mini">
</td>
<td>
{{calculate()}}
</td>
</tr>
-
的選項中進行選擇保持爲空。爲什麼? - 我如何計算這種角度的方式? (將有多個產品線可能)
很酷,非常感謝,一定會退房! – deekay