diff --git a/README.md b/README.md index 4454f9c..43a0546 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,16 @@ This directive is meant for the raw masonry lib and not the jQuery one. > First you include it on your app ```html + ``` +or + +``` +bower install angular-masonry-directive +``` + > Than setup your app ```javascript diff --git a/src/angular-masonry-directive.js b/src/angular-masonry-directive.js index 74d5e56..04f1779 100644 --- a/src/angular-masonry-directive.js +++ b/src/angular-masonry-directive.js @@ -5,7 +5,6 @@ return { restrict: 'AC', link: function(scope, elem, attrs) { - scope.items = []; var container = elem[0]; var options = angular.extend({ itemSelector: '.item' @@ -39,6 +38,10 @@ imagesLoaded( elem.get(0), update); elem.ready(update); + + scope.$watch(function () { + update(); + }); } }; });