Skip to content

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

Open
mamzellejuu wants to merge 1 commit intovasyl-stanislavchuk:masterfrom
nurun:feature/custom-pager-scoping
Open

Add attribute to be able to pass scope for the custom paging#165
mamzellejuu wants to merge 1 commit intovasyl-stanislavchuk:masterfrom
nurun:feature/custom-pager-scoping

Conversation

@mamzellejuu
Copy link
Copy Markdown

@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