Pinterest like responsive masonry grid system for angular
Documentaion on : https://github.com/s-yadav/angulargrid
Inject the module on your app
var App = angular.module('demoApp', ['angularGrid']);
Use directive as attribute defining the model you want to listen
<ul angular-grid="pics"> ..... ..... </ul>
grid-width : (Default to 250) minimum width in pixel a coloumn can have, coloumn width will increase above grid width depending on container size to make grids responsive.
gutter-size : (Default to 10) Spacing between two column
refresh-on-img-load : (Default to true) refresh the layout on image load so images does not overlap each other
If your list contains any image inside, as it will load asynchronously, plugin refresh the layout and add following classes to list item and images, so you can handle transitions of image better,
images : image-loading : when an image is loading inside list item image-loaded : when an image is loaded inside list item
list item : image-loading : when any of image is loading inside list item image-loaded : when all images are loaded inside list item
Optionally if you know dimension of images you can add data-actual-width and data-actual-height attributes, so that it will not refresh the layout when those images are loaded.
To get the refrence of instance you need to define angular-grid-id on the element which you can get back by injecting angularGridInstance to any controller or directive.