sergey-telpuk / nestjs-rbac

Awesome RBAC for NestJs
Other
426 stars 36 forks source link

Can not import RBAcModule on AppModule #70

Closed quangnv205 closed 2 years ago

quangnv205 commented 3 years ago

Can not import RBAcModule on AppModule RBAcModule.forDynamic(DynamicStorageService) Argument of type 'typeof DynamicStorageService' is not assignable to parameter of type 'new () => IDynamicStorageRbac'. Types of construct signatures are incompatible. Type 'new (repository: any) => DynamicStorageService' is not assignable to type 'new () => IDynamicStorageRbac'.ts

Capture

sergey-telpuk commented 3 years ago

Hi, I guess something wrong with your implementation of interface

MichaelHu18 commented 2 years ago

the DynamicStorageService's constructor should not have any parameters?

sergey-telpuk commented 2 years ago

the DynamicStorageService's constructor should not have any parameters?

Hi, it works like an inject service, parameters depend on nestjs implementation(di,IoC). But agree with you, we need to support parameters in constructor. If you have some improvement ideas or PR I will be pleased to consider it. Thanks for using Rbac!