Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Apply $last to the array after properties starting with $ have been filtered out #1790

Closed
wants to merge 2 commits into from

Conversation

petebacondarwin
Copy link
Contributor

Fixes #1789

…tered out

If the $last property is calculated from the original collectionLength on an object and properties starting with $ were filtered out, then $last is never applied and $middle is applied erroniously.
This fix uses the length of the filtered array instead.

Fixes angular#1789
@IgorMinar
Copy link
Contributor

I refactored your change a bit - it's better to just calculate arrayLength instead of collectionLength after the object is converted to an array.

I also extracted the test into a isolated spec. putting too much stuff into a single spec, makes the spec too complex and hard to understand when a failure occurs.

lastly I fixed up your commit message a bit.

the changes landed as 7e74601

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng-repeat $middle and $last incorrect when object contains $$hashKey
2 participants