Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

on-select page invoked twice on totalitems change #1079

@djkprojects

Description

@djkprojects

HTML Code:

<pagination on-select-page="foo(page)" page="currentPage" total-items="total" ....></pagination>

Controller Code:

$scope.currentPage = 20;
$scope.total = 20;
 ...
$scope.foo = function(page) {
   ...
   $http({...})
        .success(function(data, status) {
             ...
             $scope.total = 10;
             ...
        })
   ...
}

This scenario causes foo() being called twice due to https://github.com/angular-ui/bootstrap/blob/master/src/pagination/pagination.js#L57 and then https://github.com/angular-ui/bootstrap/blob/master/src/pagination/pagination.js#L45

The change of totalItems shouldn't invoke on-select-page

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions