diff --git a/src/app/editor/inventory-item-editor/item-property-editor/item-property-editor.component.html b/src/app/editor/inventory-item-editor/item-property-editor/item-property-editor.component.html index 5fe9335..a528c05 100644 --- a/src/app/editor/inventory-item-editor/item-property-editor/item-property-editor.component.html +++ b/src/app/editor/inventory-item-editor/item-property-editor/item-property-editor.component.html @@ -18,7 +18,7 @@ - Characteristic + Value

{{itemProperty.property}}

@@ -30,14 +30,14 @@ -
+ --> - - + + - --> + diff --git a/src/app/editor/inventory-item-editor/item-property-editor/item-property-editor.component.ts b/src/app/editor/inventory-item-editor/item-property-editor/item-property-editor.component.ts index eb88c61..987fefa 100644 --- a/src/app/editor/inventory-item-editor/item-property-editor/item-property-editor.component.ts +++ b/src/app/editor/inventory-item-editor/item-property-editor/item-property-editor.component.ts @@ -22,7 +22,7 @@ export class ItemPropertyEditorComponent implements OnInit{ editedItemProperty: ItemProperty | undefined expandedElement: ItemProperty | undefined - displayedColumns: string[] = ['name', 'property'] + displayedColumns: string[] = ['name', 'property', 'delete'] columnsToDisplayWithExpand = [...this.displayedColumns, 'expand']; datasource: MatTableDataSource = new MatTableDataSource(); @@ -30,4 +30,9 @@ export class ItemPropertyEditorComponent implements OnInit{ ngOnInit() { this.datasource.data = this.item!.itemProperties } + + deleteItemProperty(itemProperty: ItemProperty) { + this.item!.itemProperties = this.item!.itemProperties.filter(property => property.propertyName !== itemProperty.propertyName) + this.datasource.data = this.item!.itemProperties + } }