0
想顯示json數據根據參數是由狀態捕獲的參數,但問題是該數組不顯示任何東西,我使用下劃線庫,請檢查控制器,並告訴我在哪裏問題或任何其他方式做到這一點..顯示json數據acoording參數參數
.controller('abCtrl',function($scope,$http,$stateParams) {
$http.get("http://tools.vcommission.com/api/coupons.php?apikey=e159f64e3dd49fddc3bb21dcda70f10c6670ea91aac30c7cb1d4ed37b20c45b8").then(function (response) {
$scope.filteredOffers = [];
var offerName = $stateParams.offer_name;
$scope.filteredOffers = _.filter(response.data, ["offer_name",offerName]);
console.log($scope.filteredOffers)
console.log(offerName)
})
})
你在控制檯中看到數據嗎? – Sajeetharan
console.log($ scope.filteredOffers)顯示空數組,而console.log(offerName)顯示offername和response.data也提供數據。 –
我可以得到團隊查看器嗎? – Sajeetharan