Angular directive that creates a justified grid of elements
npm i -D angular-gridify
or
bower i -S angular-gridify
http://homerjam.github.io/angular-gridify/
See example for more extensive instruction.
A ratio attribute is required on the collection items to calculate layout, this should be the result of width / height.
module.controller('MyCtrl',function($scope,$window){varctrl=this;ctrl.getPerRow=function(){return$window.innerWidth>1000 ? 3 : 2;};ctrl.collection=[// items here];});<divng-controller="MyCtrl"><hj-gridifyhj-gridify-options="{ collection: ctrl.collection, perRow: ctrl.getPerRow, averageRatio: 1.5, gutter: 10, }"><divclass="tile">
Tile contents
</div></hj-gridify></div>