angular-masonry icon indicating copy to clipboard operation
angular-masonry copied to clipboard

Combined with angular-utils-pagination

Open larjohn opened this issue 10 years ago • 3 comments

For anyone else trying to do some pagination stuff, I had success by changing the pre function of the masonry directive to a post one. Just worked! Don't really understand why, but previously it would just end up ordering the items vertically.

larjohn avatar Oct 02 '14 23:10 larjohn

Sorry, don't quite understand the context here. Is this a bug? :)

passy avatar Oct 03 '14 10:10 passy

It is an 'incompatibility' issue, although I am not sure it was really intended for angular-masonry to work well with angular-utils pagination.

I wanted to have pagination for angular-masonry. My data come from an ajax request (service). I tried angualar-utils pagination but it didn't work.

To load the data I used the method described here: https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination#working-with-asynchronous-data

I am new to angular so I am not sure why, but it seemed to me that angular-masonry was doing its work too early, so it ended up rendering just a column, instead of a grid. The items were one below the other.

I found some instructions on how to override the directive without touching the file, so I did the following:

app.config(function($provide) { $provide.decorator('masonryDirective', function($delegate) { var directive = $delegate[0]; directive.link.post = directive.link.pre; delete(directive.link.pre); return $delegate; }); });

It worked, and now I have a paginated angular-masonry, so I wanted to share with anyone trying the same.

larjohn avatar Oct 03 '14 10:10 larjohn

I can't believe but it worked perfectly!, hope no surprises comes up! :+1:

WilmerTV avatar Sep 14 '15 22:09 WilmerTV