Created
November 25, 2012 05:32
-
-
Save rajaraodv/4142505 to your computer and use it in GitHub Desktop.
foobar directive w/ imagesloaded (step2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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