This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Truely empty objects in ngRepeat #1944
Closed
Description
Let's say I have a pseudo-hashmap built using Object.create(null)
and I want to ng-repeat over it.
This is breaking :
<div ng-repeat="(key,value) in myHashmap"></div>
Because obviously my hashMap doesn't inherit the Object prototype and thus doesn't have the hasOwnProperty method.
Can be quickly fixed by changing the size function
if (!ownPropsOnly || Object.hasOwnProperty.call(obj,key))
and the ngRepeatDirective
if (Object.hasOwnProperty.call(collection,key) && key.charAt(0) != '$') {
However I'd love to have some feedbacks from the team if this is actually on purpose. Thanks!
Metadata
Metadata
Assignees
Labels
No labels