[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Feature request
[ x] Documentation issue or request
I have an object that has a custom id field. For example I have a "Location" object and my id field is called "locationid" instead of just "id". From all the examples and test I've ran, it looks like I need an "id" field.
How do I map my "locationid" to "id"?
My object
export interface Location {
locationid: number,
name: string,
address: string
}
node v8.6.0
npm 5.5.1
ngrx 4.1.1
If you are talking about ngrx/entity, just specifiy a selectId method when creating your EntityAdapter.
See https://github.com/ngrx/platform/blob/master/docs/entity/adapter.md#createentityadapter
export const adapter: EntityAdapter<Location > = createEntityAdapter<Location>({
selectId: (location: Location) => location.locationid,
});
Support questions should be handled in the support channel or stackoverflow
Most helpful comment
If you are talking about ngrx/entity, just specifiy a selectId method when creating your EntityAdapter.
See https://github.com/ngrx/platform/blob/master/docs/entity/adapter.md#createentityadapter