I use the Angular InMemoryService to store some fake data. I would like to transform the "HashtagDB" property into the array "hashtags". This "hashtags" array should only contain the values, but not the labels, so that I can use it to display it as Angular-Material-Chips.
As far as I understand, HashtagDB is an array property of an unnamed object. Is that correct? How do I transform the data from the array?
export class InMemoryDataService implements InMemoryDbService {
createDb() {
const person = [
{ Id: 1,
HashtagsDB: [ {hashtag: 'world'}, {hashtag: 'digital'}, {hashtag: 'economy'},
];
return {person};
}
}
hashtags: string[] = [/*'world', 'digital', 'economy*/];