0
Angular JS
의 새로운 기능입니다. 나는 각도 js에서 caraousel
에 일하고있다. DIV
에 4의 SET가 있습니다.각도 번호가 정의 된 번호로 반복됩니다.
ng-if="$index % 4 == 0"
을 사용한 후에 div가 생성되었지만 4 개의 항목을 가져올 수 없습니다.
반복적으로 4 개 항목을 가져 오는 데 INDEX를 어떻게 사용할 수 있습니까? DIV
?
<div class="carousel-inner" ng-init="getSpecialDeals()">
<div class="item" ng-class="{active: $index==0}" ng-repeat="specialDeals in SpecialDealsList" ng-if="$index % 4 == 0">
<div class="row text-center">
<!-- ITEM-->
<div class="span3">
<div class="thumbnail product-item">
<a href="#">
<img ng-src="{{specialDeals.images}}">
</a>
</div>
<h3> {{specialDeals.name}} </h3>
<p><a class="btn btn-large btn-block" href="http://www.bootstraptor.com">View details »</a>
</p>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="span3">
<div class="thumbnail product-item">
<a href="#">
<img src="https://s-media-cache-ak0.pinimg.com/564x/16/03/33/160333e0e9d6563729313131ff755964.jpg">
</a>
</div>
<h3> {{specialDeals.name}}</h3>
<p><a class="btn btn-large btn-block" href="http://www.bootstraptor.com">View details »</a>
</p>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="span3">
<div class="thumbnail product-item">
<a href="#">
<img src="https://s-media-cache-ak0.pinimg.com/564x/16/03/33/160333e0e9d6563729313131ff755964.jpg">
</a>
</div>
<h3>Product name</h3>
<p><a class="btn btn-large btn-block" href="http://www.bootstraptor.com">View details »</a>
</p>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="span3">
<div class="thumbnail product-item">
<a href="#">
<img src="https://s-media-cache-ak0.pinimg.com/564x/16/03/33/160333e0e9d6563729313131ff755964.jpg">
</a>
</div>
<h3>Product name</h3>
<p><a class="btn btn-large btn-block" href="http://www.bootstraptor.com">View details »</a>
</p>
</div>
<!-- ITEM-->
</div>
</div>
function _getSpecialDeals() {
if (document.getElementById('FCDivID')) {
$scope.requestData = $scope.requestData + '&category_id=' + $scope.featuredCategoryId;
}
$http(
{
method : 'POST',
url : $scope.base + '/specialoffers/GetSpecialDeals',
crossDomain : true,
headers : {
'Content-Type' : 'application/x-www-form-urlencoded',
'key' : 'xxxxxxxxxxx'
},
data : $scope.requestData,
})
.then(
function successCallback(response) {
document.getElementById("gifLoader").style.display = "none";
//document.getElementById("gifLoader1").style.display = "none";
document.getElementById("loader").style.display = "none";
if(response.data.SpecialProductsList!=undefined){
if(response.data.SpecialProductsList.length<5){
$scope.flagArrow=false;}
}
if (response.data.status == "200") {
$scope.specialDeals = response.data;
$scope.totalPages = response.data.total_pages;
if ($scope.pageNumber > 1) {
for (var i = 0; i < response.data.SpecialProductsList.length; i++) {
$scope.SpecialDealsList
.push(response.data.SpecialProductsList[i]);
}
} else {
$scope.SpecialDealsList = $scope.specialDeals.SpecialProductsList;
}
if (document
.getElementById("list_item")) {
$scope.SpecialDealsList
.push({
"product_id" : "1",
"name" : "Get All Deals",
"product_selling_price" : "0.00",
"wish_list" : "False",
"images" : "img/view-more.jpg",
"product_special_from_date" : "",
"product_special_to_date" : "",
"product_special_price" : "",
})
};
}
/*document.getElementById("wpf-loader-two").style.display = "none";*/
});
}
}
R 대신 단일 '='
대신 기입 getSpecialDeals 함수()의 이렇게의 한 번 귀하의 게시물을 귀찮게하고 그것이 의미있는 확인하십시오? 컨트롤러는 어디 있습니까? ** getSpecialDeals() **는 의미합니까? ** SpecialDeals **는 의미합니까? – Aravind