Skip to content

Instantly share code, notes, and snippets.

@xlewkanx
Last active October 12, 2015 19:28
Show Gist options
  • Select an option

  • Save xlewkanx/8829dbc002cedf122da6 to your computer and use it in GitHub Desktop.

Select an option

Save xlewkanx/8829dbc002cedf122da6 to your computer and use it in GitHub Desktop.
image on load
function imageOnLoad($q) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var dfd = $q.defered();
element.bind('load', function(e) {
dfd.resolve();
});
return dfd;
}
}
}
div#cliclable(
ng-repeat="poster in posters.postersArr | filter: {outerIndex: $parent.slider.outerIndex}"
ng-click="posters.openPost($event, poster.outerIndex, poster.innerIndex)"
my-poster-place
)
img(ng-src="{{poster.pictureUrl}}" image-on-load)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment