将数据从DOM传递到不工作angularJS的范围

时间:2016-09-23 17:35:53

标签: javascript angularjs dom scope ng-repeat

我在一件事情上自杀:我正试图将一个对象从DOM传递给我的控制器。在此对象中,有一个包含n个值的对象数组。但是当我在我的范围函数中得到它时,它说该数组由1个对象组成。

HTML

<div ng-if="statePage == 'listeProducts' && listProducts != null"  ng-repeat="product in listProducts" class="product_item"  ng-mouseenter="negativeInformation(product)" ng-mouseleave="normalInformation(product)" ng-click="showProductDetails(product, product.size)" ng-class="{'br': $index % 2 == 0}"> 

..Doing my stuff...

</div>

JS

$scope.showProductDetails = function(product, sizes) {
console.log(sizes); 
}

即使我的浏览器控制台也显示出奇怪的东西..

enter image description here

有什么想法吗?

编辑:这是我的listProducts的console.log:

enter image description here

0 个答案:

没有答案