Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attribute to be able to pass scope for the custom paging #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mamzellejuu
Copy link

@mamzellejuu mamzellejuu commented Nov 29, 2016

I added an attribute for the directive to be able to pass scope the custom paging.

<slick infinite="true" autoplay="false" centerMode="true" dots="true", prev-arrow=".slick-prev" next-arrow=".slick-next" custom-paging="customPaging(slick, index)" custom-paging-scope="useScope"></slick>
$scope.customPaging = (slick, index) => {
      let $currentSlide = $(slick.$slides[index]);
      let url = $currentSlide.data('analytics-event');
      let label = $currentSlide.data('analytics-label');
      let category = $currentSlide.data('analytics-category');

      return '<button type="button" ng-click="ngFn()" data-role="none" role="button" tabindex="0"  analytics-on="click" analytics-event="' + url + '" analytics-category="' + category + '" analytics-label="' + label + '">' + index + '</button>';
    }

It may be useful in some cases to have access to a different scope as in the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant