2
有2個div標籤,我想根據SelectedVariant.InCart的值僅顯示1。ng-if同時顯示div元素
代碼如下:
<div ng-if="1==0">
<a class="btn btn-success btn-md" ng-click="AddToCart(product.ProductID, SelectedVariant.VariantID)">Add to Cart
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
<div ng-if="1==1">
<a class="btn btn-default btn-xs" ng-click="PlusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-plus"></span>
</a>
<button type="button" class="btn btn-info disabled">{{3+2}} in cart</button>
<a class="btn btn-default btn-xs" ng-click="MinusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-minus"></span>
</a>
</div>
<a class="btn btn-default btn-xs" ng-click="MinusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-minus"></span>
</a>
</div>
但同時顯示的div元素。有人可以幫我解決問題嗎?
什麼'SelectedVariant.InCart.'? – 2015-04-03 16:57:45
它在ng-repeat循環中的一個元素 – 2015-04-03 16:58:47
可以發佈'ng-repeat'的代碼嗎? – 2015-04-03 17:00:17