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

Cannot set a custom bullet render function #38

Open
andrepestana opened this issue Feb 19, 2019 · 1 comment
Open

Cannot set a custom bullet render function #38

andrepestana opened this issue Feb 19, 2019 · 1 comment

Comments

@andrepestana
Copy link

I'm trying to set a custom renderBullet function:

<section id="main-swipe" class="swipe" ng-controller="SwipeController">
     <swiper pagination-type="bullets" pagination-bullet-render="renderBullet">
       ...
    </swiper>
</section>
module.controller("SwipeController", function($scope) {
  $scope.renderBullet = function (index, className) {
    return '<span class="' + className + '">' + (index + 1) + '</span>';
  };  
});

But I got:

TypeError: x.params.paginationBulletRender is not a function
    at i.x.updatePagination (angular-ui-swiper.min.js:1)
@andrepestana
Copy link
Author

Actually I realized that I should use double braces as in:

<section id="main-swipe" class="swipe" ng-controller="SwipeController">
     <swiper pagination-type="bullets" pagination-bullet-render="{{renderBullet}}">
       ...
    </swiper>
</section>

but still the value got in ui-swiper is a string and I get the same error. I'm pulling a request to change the code. Please evaluate the change.

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

No branches or pull requests

1 participant