I've encountered an issue while working on my Angular 5 application. I have a model class called RoleClaimEntryDataModel and a method 'UpdateRoleClaimById' in one of my injectable services that takes RoleClaimEntryDataModel as a parameter. However, when I try to assign this object to the RoleClaimEntryDataModel of the class, I receive an error.
Error
Type 'RoleClainEntryDataModel' is not assignable to type 'typeof RoleClaimEntryDataModel'.
Property 'prototype' is missing in type 'RoleClaimEntryDataModel'.
Model Class
export class RoleClaimEntryDataModel{
roleId:string;
claimId:string;
isClaimAssignToRole:boolean;
}
Injectable Service A
@Injectable()
export class UpdateRoleClaimCommand extends BaseCommand<boolean> {
public data = RoleClaimEntryDataModel;
initialise(): void {
super.setBody(this.data);
}
}
Injectable Service B
@Injectable()
export class PermissionDataService{
constructor(
private updateRoleClaimCommand: UpdateRoleClaimCommand
){}
public UpdateRoleClaimById(roleClaimEntryDataModel: RoleClaimEntryDataModel)
{
this.updateRoleClaimCommand.data = roleClaimEntryDataModel; // throw error here
}