We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data
any-entity.module.ts
@NgModule({ providers: [AnyEntityService , AnyEntityDataService], }) export class AnyEntityModule { constructor( entityPaginationService: EntityPaginationService, entityDataService: EntityDataService, dataService: AnyEntityDataService ) { entityDataService.registerService('AnyEntity', dataService); entityPaginationService.registerEntity('AnyEntity'); } }
any-entity.service.ts
@Injectable() export class AnyEntityService { private readonly entityServices: EntityServices = inject(EntityServices); private readonly entity = this.entityServices.getEntityCollectionService<AnyTypeExample>('AnyEntity'); delete = (uniquePropertyNumber : number) => this.entity.delete(uniquePropertyNumber); }
api.module.ts
@NgModule() export class ApiStateModule { public static forRoot(configurationFactory?: () => Configuration): ModuleWithProviders<ApiModule> { const providers = []; if (configurationFactory) { providers.push({ provide: Configuration, useFactory: configurationFactory }); } return { ngModule: ApiStateRootModule, providers }; } } export const entityMetadata: EntityMetadataMap = { AnyEntity: { selectId: ({ uniquePropertyNumber }: { uniquePropertyNumber: number }) => uniquePropertyNumber, } }; @NgModule({ imports: [ AnyEntityModule, ApiStateModule, ], }) export class ApiStateRootModule {}
If I now call the delete-method with 0 as key this.anyEntityService,delete(0);
I get "Uncaught (inpromise): Error: should be a single entity key" at this point:
My quickfix currently is to typecast: delete = (uniquePropertyNumber: number) => this.entity.delete(`${uniquePropertyNumber}`);
NgRx: ^14.3.3 Angular: ^14.2.12 Node: v16.14.0 Browsers: Edge, Firefox OS: Windows 10
No response
The text was updated successfully, but these errors were encountered:
fix(data): allow 0 to be a valid key (#3830)
e50126d
Closes #3828
Successfully merging a pull request may close this issue.
Which @ngrx/* package(s) are the source of the bug?
data
Minimal reproduction of the bug/regression with instructions
any-entity.module.ts
any-entity.service.ts
api.module.ts
Minimal reproduction of the bug/regression with instructions
If I now call the delete-method with 0 as key this.anyEntityService,delete(0);
I get "Uncaught (inpromise): Error: should be a single entity key" at this point:
My quickfix currently is to typecast: delete = (uniquePropertyNumber: number) => this.entity.delete(`${uniquePropertyNumber}`);
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)
NgRx: ^14.3.3
Angular: ^14.2.12
Node: v16.14.0
Browsers: Edge, Firefox
OS: Windows 10
Other information
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: