jelgblad / angular2-masonry

https://github.com/desandro/masonry module for Angular2
101 stars 48 forks source link

Trigger layout method #46

Open dbartumeu opened 7 years ago

dbartumeu commented 7 years ago

I want to trigger layout method every time that I add some content to the masonry-brick element, there is a way to get the _msnry Objet once layoutComplete is triggered?

peterViou commented 7 years ago

I have the same problematic ? Do you get a way to do it ?

simonpeters commented 7 years ago

any update on this?

jasonburrows commented 6 years ago

Does this help?

In your component get a reference to the component:

@ViewChild(AngularMasonry) private masonry: AngularMasonry;

Then trigger the layout update like this:

                setTimeout( () => {
                    if (this.masonry){
                        this.masonry._msnry.reloadItems();
                        this.masonry.layout();
                    }
                });