angular-filter icon indicating copy to clipboard operation
angular-filter copied to clipboard

groupBy: If property is undefined or null, do not group it together

Open ericjames opened this issue 9 years ago • 0 comments

Undefined or null implies the property is not set meaning do not group it, it is unique. This uses the key property, prefixed with _$ to assign it a unique placeholder value and then assign the element itself to that value.

Therefore ng-repeat

[
{  "color": "red" },
{  "color": "red" },
{  "color": null }
]

Groups into:

[{
    "red": [{
        "color": "red"
    }, {
        "color": "red"
    }]
}, {
    "_$3": [{
        "color": null
    }]
}]

ericjames avatar Sep 11 '16 05:09 ericjames