Answer the question
In order to leave comments, you need to log in
How can a TypeScript entry be shortened?
return this.layerService.getLayerItems(layer.groupNode.id).map((item: LayerItemGenericDecription) => {
let {title, description } = this.layersSemanticService.getTitleDescription(item, layer.groupNode.id);
item.title = title;
item.description = description;
return item;
});
return {irem.title, item.description} = this.layersSemanticService.getTitleDescription(item, layer.groupNode.id);
Answer the question
In order to leave comments, you need to log in
it's better that way
return this.layerService.getLayerItems(layer.groupNode.id)
.map((item: LayerItemGenericDecription) => {
const { title, description } = this.layersSemanticService.getTitleDescription(item, layer.groupNode.id);
return { ...item, ...{ title, description }};
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question