Skip to content

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