michaelbromley / michaelbromley/angularUtils

dirPagination: current-page re-uses old value from previous call on second call

Open
#438 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2k
Forks
842
PR merge metrics
No merged PRs in 30d

Description

Description of issue:
seems that the previous directive does not get cleaned up after the first call AND that the re-initialization of current-page does not work correctly on the second call

Steps to reproduce:

  • open page with dirPagination directive (id "test") & initialise "current-page" from variable "pagination.current"
  • open page again with dirPagination directive (id "test") & initialise "current-page" from variable "pagination.current" with different value

Expected result:

  • current-page value from second call is used

Actual result:

  • current-page value from first call is used

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the dirPagination directive using the two initialization sequences described in the issue, changing pagination.current between calls. Trace how the directive handles cleanup and current-page initialization; done means the second call uses its new current-page value rather than the value from the first call.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.