1
我有一個if指令(它工作正常)。AngularJS IF Directive使用列
當我點擊名稱時,它顯示圖片。
但我想在其他行的影像:
<!-- COLUMN 1 -->
<div class="col-md-4">
<div ng-repeat="product in products">
<h3><a style="cursor: pointer;" ng-click="products.chosen = product">name: {{product.name}}</a> </h3>
<!-- add image to colum 2 -->
<img ng-if="products.chosen == product" ng-src="{{product.url_image}}"/>
</div>
</div>
<!-- IMAGES COLUMN 2-->
<div class="col-md-4">
<!-- this doesn't work -->
<img ng-if="products.chosen == product" ng-src="{{product.url_image}}"/>
</div>
這裏是樣機:
當我點擊這個名字,我有一個畫面出現剛向下。 我想要在Column2中顯示圖像。
感謝您的幫助!
卡洛斯
嘿卡洛斯,可以ü把你如何指望它的一些屏幕截圖? – Kailas 2014-10-06 12:20:01
你想在第2列中選擇所有圖像? – dfsq 2014-10-06 12:25:26
是的,在第2欄中選擇的圖像。只是添加了模型。謝謝! – Carlos 2014-10-06 12:27:35