angular / in-memory-web-api

The code for this project has moved to the angular/angular repo. This repo is now archived.
MIT License
1.18k stars 232 forks source link

Ennummerable properties with a value of undefined are removed from the resulting data #176

Open joshuaball opened 6 years ago

joshuaball commented 6 years ago

I'm working with dummy data that is in this form:

[{ id: 10021002, value1: undefined, value2: false, ... }...]

When I receive the data from the in-memory-web-api, the ennumerable properties of the dummy data object with undefined values have been removed. I expected the properties to be carried forward with their undefined value.

Thanks,

-Josh

wardbell commented 6 years ago

Have you tried setting them to null instead? I think this is intentional behavior ... although I can't remember why.

joshuaball commented 6 years ago

That could be done, but it would change the expected behavior when we switch over to use the API that is being built. We're implementing the API with any properties that have no value just passing an undefined value back. Can you help me understand why this is intentional?