We have to use custom scope varibale within ng-repeat using angularjs, but it will return last value to all
{{discountvalue}}
$http.get('/api/Product/ListOnlyProductOrderFeatured/', { params: {} }).success(function (data) {
$scope.UserProduct = data;
for (var i = 0; i < $scope.UserProduct.length; i++) {
$scope.generalprice = $scope.UserProduct[i].ec_shop_product_price;
$scope.discountprice = $scope.UserProduct[i].ec_shop_product_discount;
$scope.discountvalue = $scope.generalprice - $scope.discountprice;
}
})
Please anyone explain how to do ASAP
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sudarvizhi JPosted Mar 16, 2018, 3:46 AM
Debasis SahaPosted Mar 16, 2018, 1:44 AM
Sudarvizhi JPosted Mar 16, 2018, 1:31 AM
Debasis SahaPosted Mar 16, 2018, 1:27 AM