How can I manage factories in separate files

I want to manage my factories in separate file per model. How can I do that?
If I create separate file it throws me error but works if I put same code in factory.js file.

TypeError: Cannot read property 'name' of undefined

Please share the code which throws that error message.
Also if you can elaborate what you are trying to achieve, it would be nice.

1 Like