Skip to content

document $emit('masonry.layout') and default masonry options #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ var myApp = angular.module('MyApp',['masonry']);
> And then just use it (note that the masonry directive uses the same pattern as the masonry directive uses http://masonry.desandro.com/

```html
<!-- default options: { itemSelector: ".item" } -->
<div masonry='{ "transitionDuration" : "0.4s" , "itemSelector" : ".tile"}'>
<!-- items -->
<div masonry-tile ng-repeat="item in items">

</div>
</div>
```

> When something has changed in your layout and you want to updated masonry, simply call `scope.$emit('masonry.layout')`:

```html
<div masonry class="{{containerClass}}">
...
<button ng-click="containerClass = 'bigger'; $emit('masonry.layout')" />
</div>
```