Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: groupBy breaking under certain conditions #153

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update count-by.js
Stronger type checking. 

If the value of prop is something like "valueOf", or "watch", then by the previous logic, the elm wouldn't be grouped at all, since reult[prop] would be a function, and wouldn't have the property "push".
  • Loading branch information
adwaith-implementhit committed Oct 8, 2015
commit df8f2de9114b51cd8815d18c277cba16e20f68ae
2 changes: 1 addition & 1 deletion src/_filter/collection/count-by.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ angular.module('a8m.count-by', [])
collection.forEach( function( elm ) {
prop = get(elm);

if(!result[prop]) {
if(!isArray(result[prop])) {
result[prop] = 0;
}

Expand Down