Answer the question
In order to leave comments, you need to log in
How to collect your object from Interface?
export interface IActivity {
createdByUser: IActivityUser[];
assignedToUser: IActivityUser[];
activityType: IActivityType[];
note?: string,
finished: boolean,
activityTime: string
}
interface IActivityType {
id: number;
name: string;
}
export interface IActivityShort {
time: string;
title: string;
note: string;
author: string;
}
@computed public get activitiesMap(): IActivity[] {
const result = [];
if (this.activities) {
this.activities.map((activity, index) => {
console.log(activity.activityType);
const activityShort: IActivityShort = {
time: activity.activityTime,
title: activity.activityType.name,
note: activity.note,
author: activity.createdByUser.name
};
result.push(activityShort);
});
}
return result;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question