Created
December 17, 2015 12:11
-
-
Save mxmzb/9ef972222e8334d6647d to your computer and use it in GitHub Desktop.
slick directive
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
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)); | |
} | |
}; | |
}); |
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
<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