A Pen by Nishchith J Bangar on CodePen.
Last active
April 12, 2017 08:48
-
-
Save NishiBangar/78e9766901280868bcb115a3122dfd26 to your computer and use it in GitHub Desktop.
Print array elements in grid format using multiple "ng-repeat"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html ng-app="myApp"> | |
<body ng-controller="myController"> | |
<div class="row"> | |
<div class="col-sm-3" ng-repeat="remainder in [0,1,2 ]"> | |
<div ng-repeat="item in array" ng-if="$index % 3 == remainder"> | |
{{item}} | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myApp=angular.module("myApp",[]); | |
myApp.controller("myController",['$scope',function($scope){ | |
$scope.array=[1,2,3,4,5,6,7,8,9,10]; | |
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment