Angular directive that creates balanced columns
-
Add
hj.columnifyto your app dependencies -
Add
.columnstyle declaration to your css
.column {
float: left;
width: 50%; /* 50% for two columns, 33.33% for three etc */
}- Add
hj-columnifydirective to your template, it works just likeng-repeat
<div hj-columnify="item in items">
<div class="box" data-index="{{$index + 1}}">
Content goes here
</div>
</div>npm i -S angular-columnify