I am trying to have UserRoles shown as badges next to the UserName in the users table using a PropContributor.
Could I use the getRoles(data.record.id) api from IdentityUserService here somehow? Thanks!
export function userNamePropContributor(propList: EntityPropList<IdentityUserDto>) {
const droppedNode = propList.dropByIndex(0);
const userNameProp = new EntityProp<IdentityUserDto>({
...droppedNode.value,
valueResolver: data => {
const roles = // getRoles(data.record.id) api from IdentityUserService??
return of(data.record.userName + roles);
},
});
propList.addByIndex(userNameProp, 0);
}
Solved with:
const service = data.getInjected(IdentityUserService);