Does someone know why if I do 'drawStock="drawStock' like
<tr ng-repeat="icl in ic.internal_consumption_lines" drawStock="drawStock(locator_id, product_id)" ...></tr>
And then in my script
scope: {
...
drawStock: "&",
...
},
template:{
...
<span>{{drawStock({locator_id:ic.internal_consumption_lines[index].transaction.locator.id, product_id:ic.internal_consumption_lines[index].transaction.product.id})}}</span>
...
...
$scope.drawStock = (lid, pid) ->
for i of $scope.product_stocks
if $scope.product_stocks[i].locator_id == lid
if $scope.product_stocks[i].product_id == pid
return $scope.product_stocks[i].stock
The drawStock function won't display the stock, but if I change the attribute for a different name than the value, let's say something like 'drawstock="drawStock(...' it works...:
<tr ng-repeat="icl in ic.internal_consumption_lines" drawstock="drawStock(locator_id, product_id)" ...></tr>
And then in my script
scope: {
...
drawstock: "&",
...
},
template:{
...
<span>{{drawstock({locator_id:ic.internal_consumption_lines[index].transaction.locator.id, product_id:ic.internal_consumption_lines[index].transaction.product.id})}}</span>
...
...
$scope.drawStock = (lid, pid) ->
for i of $scope.product_stocks
if $scope.product_stocks[i].locator_id == lid
if $scope.product_stocks[i].product_id == pid
return $scope.product_stocks[i].stock