Skip to content

Instantly share code, notes, and snippets.

@rajaraodv
Created November 25, 2012 05:32
Show Gist options
  • Save rajaraodv/4142505 to your computer and use it in GitHub Desktop.
Save rajaraodv/4142505 to your computer and use it in GitHub Desktop.
foobar directive w/ imagesloaded (step2)
//Added imagesLoaded code to wait for all images to load before we apply masonry.
//But this wasn't working either! Because Angular hasn't converted ng-src="path/to/img" to src="path/to/img"
clientAppModule.directive('addMasonry', function($timeout) {
return {
restrict: 'A',
link: function(scope, element) {
scope.container.imagesLoaded(function() {
scope.container.masonry('reload');
});
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment