Skip to content

Instantly share code, notes, and snippets.

@mxmzb
Created December 17, 2015 12:11
Show Gist options
  • Save mxmzb/9ef972222e8334d6647d to your computer and use it in GitHub Desktop.
Save mxmzb/9ef972222e8334d6647d to your computer and use it in GitHub Desktop.
slick directive
angular.module('myapp.directives', [])
.directive('slick-carousel', '$eval', function($eval) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
angular.element(element).slick(scope.$eval(attrs.directiveName));
}
};
});
<div class="exercise-carousel" slick-carousel>
<img ng-repeat="photo in exercise.photos" ng-src="{{getPhotoUrl(photo.image)}}" />
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment