Skip to content Skip to sidebar Skip to footer

Angularjs Ng-repeat And Packery.js

I am trying to implement packery in an angularJS application. When I define the items manually one by one (see the commented html code), Packery works fine. When I try to do the sa

Solution 1:

Okay, I found the answer.

1) I had to use a directive with an event to be received by the controller

2) I had to add a setTimeout.

app.directive('lastRepeat', function () {
    returnfunction(scope, element, attrs) {
        if (scope.$last) setTimeout(function(){
            scope.$emit('LastElement', element, attrs);
        }, 1);
    };
});

Post a Comment for "Angularjs Ng-repeat And Packery.js"