michaelbromley / michaelbromley/angularUtils

When calling $compile on a code containing dirPagination, registered pagination-id is not found

Open
#269 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm dynamically pulling in HTML code and running it through $compile after adding it to my DOM and everything seems to be working except that I'm now getting the following error message: **pagination directive: the itemsPerPage id argument (id: locations) does not match a registered pagination-id**

It appears that the dir-paginate directive is getting compiled before the dir-pagination-controls directive and is therefore unable to find the registered pagination-id. How do I get around this?

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 dynamic HTML flow with $compile and the dir-paginate and dir-pagination-controls directives. Trace when the pagination-id is registered versus when the compiled pagination directive looks it up. Done means dynamically compiled code no longer reports that the locations pagination-id is unregistered.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.