I want to skip every third number from logic, I tired but I'm not getting the correct way. output should be like this: 0,1,3,4,6,7,9,10,12...
I tried this, but its not working fully. **
for (var item = 0; item < $scope.gridImportData.data.length; item++)
{
$scope.gridImportData[item] + (($scope.gridImportData[item] - 1) / 3)
}
**
Try this
angular.module("a",[]).controller("ac",function($scope){
$scope.querylist =[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];
$scope.newValue=[];
for (var item = 0; item < $scope.querylist.length; item++){
if($scope.querylist[item] % 3 == 0 && $scope.querylist[item] !=0) {
continue;
}
$scope.newValue.push($scope.querylist[item]);
}
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="a" ng-controller="ac">
<table>
<tr ng-repeat="x in newValue">
<td>{{x}}</td>
</tr>
</table>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With