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

add feature to choose the property name of the primary key of collection #159

Open cHullaert opened 6 years ago

cHullaert commented 6 years ago

Based on the model of createDb method on the inMemDbService in the BackendService, it's possible to define on the Service the method defineId which takes the collection name in parameter and returns the property name of the key.

By default, the behaviour of the component still unchanged since if the method is not defined the whole collections used the id name.

It is useful to link to an existing model domain

specifications is added raw Angular Http w/ override id service can get heroes can get heroes by uuid

googlebot commented 6 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


googlebot commented 6 years ago

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

cHullaert commented 6 years ago

I signed it!

cHullaert commented 6 years ago

Arf maybe I should create my merge request on more-dev branch instead of master..

wardbell commented 5 years ago

I think this is a good idea. It's an extension I've wanted myself and had intended to do something like this and along the lines of the id handling in @ngrx/entity.

I don't know when or if it will happen. I'm keeping your PR around as a reminder of what could be.

You may want to fork this library for your own needs.