Reputation: 893
I'm trying to use ngrx/data with my api. My api exposes resources under the format /resources for all requests instead of POST /resource (without 's'). Same for GET /resources/:id instead of /resource/:id as required by ngrx/data.
How can I force the data service to hit /resources for all requests? Thanks
Upvotes: 1
Views: 388
Reputation: 11
You might use an entity-metadata.ts files with following content:
const entityMetadata: EntityMetadataMap = {
ressources: {}
};
const pluralNames = {
ressources: 'ressources'
};
export const entityConfig = {
entityMetadata,
pluralNames,
};
In your module you need an import with:
EntityDataModule.forRoot(entityConfig)
Upvotes: 1