Skip to content
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

Scope Watch #3

Open
fmulyono opened this issue Nov 19, 2013 · 6 comments
Open

Scope Watch #3

fmulyono opened this issue Nov 19, 2013 · 6 comments

Comments

@fmulyono
Copy link

Hi there,
First of all, great work! I've been stuck with lots of other masonry alternative and trying to tying them to Angular. Yours worked just fine.

One thing I would add though. It doesn't have any scope monitoring that it couldn't update the layout once the data are updated.

@fmulyono
Copy link
Author

My bad. That's not the actual problem.
After more thorough testing, the problem is in elem.ready.

By using that event, it limits the items on first DOMReady event. Which means, if the items are to be modified after, it won't trigger relayout. I ended up setting-up timeout of 10ms to trigger relayout instead of relying on elem.ready event.

Any suggestions?

@klederson
Copy link
Owner

Yes, elem.ready is an option that can be removed once it generates no problem with back compatibilities, can you run some tests?

@gablabelle
Copy link

@klederson how it the best way to achieve this from a Controller ? (not in angular-masonry-directive.js directly)

Many thanks for your time and help.

@gablabelle
Copy link

@klederson in the meantime I added to you directive and it works

                scope.$watch(function () {
                    update();
                });

@klederson
Copy link
Owner

Hi @gablabelle i think using events ( and firing it from masonry directive ) could be a nice way to do that, this scope.$watch will drain your performance. I'll try to find out more time to help on this but suggestions are welcome )

@xeor
Copy link

xeor commented Jun 7, 2015

Is there any solutions for this? I need to keep loading my items until they are out of the viewport.
My plan was to use the one of http://masonry.desandro.com/events.html and layoutComplete, but currently, I need to mix in jquery code to get something like this working. Where is https://github.com/klederson/angular-masonry-directive/blob/master/src/angular-masonry-directive.js#L41 coming from? I tryed listening for masonry.layoutComplete, but that was also a no-go..

jo-flynn pushed a commit to jo-flynn/angular-masonry-directive that referenced this issue Jul 22, 2016
Allow multiple masonry containers on one page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants