fix(copy) $resource throws TypeError when json has both properties & arrays

Closes #1044