[Homepage](https://passy.github.io/angular-masonry)
npm install angular-masonryAn AngularJS 1 directive to work with David Desandro's Masonry.
1. Install via either bower or npm:
1. bower install --save angular-masonry
2. npm install --save angular-masonry
2. Add wu.masonry to your application's module dependencies.
3. Include dependencies in your HTML.
``html
`
4. Use the masonry directive.
See the homepage for a live example.
`html`
You have to include the masonry attribute on the element holding the bricks.masonry-brick
The bricks are registered at the directive through the CSS
classname.
The directive optionally uses imagesloaded
to determine when all images within the masonry-brick have been loaded and addsloaded
the CSS class to the element, so you can add custom styles and
prevent ghosting effects.
(Default: .masonry-brick)
You can specify a different item
selector through the
item-selector attribute. You still need to use masonry-brick either as class
name or element attribute on sub-elements in order to register it to the
directive.
Example:
`html`
Unicorns
Sparkles
The column-width attribute allows you to override the the width of a column
of a horizontal grid. If
not set, Masonry will use the outer width of the first element.
Example:
`html`
This will be 200px wide max.
The preserve-order attributes disables the imagesLoaded logic and will
instead display bricks by the order in the DOM instead of by the time they are
loaded. Be aware that this can lead to visual glitches if the size of the
elements isn't set at the time they are inserted.
Example:
`html`
Allows usage of imagesLoaded plugin. Defaults to false.
Example:
`html`


The reload-on-show attribute triggers a reload when the masonry element (or anng-show
ancestor element) is shown after being hidden, useful when using orng-hide. Without this if the viewport is resized while the masonry element is
hidden it may not render properly when shown again.
Example:
`html`
...
...
When showList changes from falsey to truthy ctrl.reload will be called.
The reload-on-resize attribute triggers a reload when the masonry element changes
its width, useful when only the parent element is resized (and not the window) and
you want the elements to be rearranged. Without this if the parent is resized then
some blank space may be left on the sides.
Example:
`html`
...
...
You can provide additional options
as expression either as masonry or masonry-options attribute.
Example:
`html`
Equivalent to:
`html`
Bricks are appended by default. This behavior can be specified for each brick by
providing the prepend attribute.
Example:
`html``
...
The directive is based on
a StackOverflow question
answered by James Sharp.
Please refer to CONTRIBUTING.md before opening issues or pull
requests.
MIT
