refactor: make data list reusable component

Closes #98
This commit is contained in:
Jovan Krunić
2021-04-15 17:24:15 +02:00
parent c97ecd698c
commit a8f22c1e96
15 changed files with 472 additions and 354 deletions

View File

@@ -14,6 +14,7 @@
*/
import {Component, Input} from '@angular/core';
import {SCThings} from '@openstapps/core';
import {DataRoutingService} from '../data-routing.service';
/**
* Shows data items in lists such es search result
@@ -28,4 +29,13 @@ export class DataListItem {
* An item to show
*/
@Input() item: SCThings;
constructor(private dataRoutingService: DataRoutingService) {}
/**
* Emit event that an item was selected
*/
notifySelect() {
this.dataRoutingService.emitChildEvent(this.item);
}
}