mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
55693: Working store interaction for selecting items
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { ItemDataService } from '../../core/data/item-data.service';
|
||||
import { PaginatedList } from '../../core/data/paginated-list';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
@@ -21,13 +21,16 @@ export class ItemSelectComponent implements OnInit {
|
||||
@Input()
|
||||
paginationOptions: PaginationComponentOptions;
|
||||
|
||||
checked: boolean[] = [];
|
||||
@Output()
|
||||
confirm: EventEmitter<string[]> = new EventEmitter<string[]>();
|
||||
|
||||
selectedIds$: Observable<string[]>;
|
||||
|
||||
constructor(private itemSelectService: ItemSelectService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.itemsRD$.subscribe((value) => console.log(value));
|
||||
this.selectedIds$ = this.itemSelectService.getAllSelected();
|
||||
}
|
||||
|
||||
switch(id: string) {
|
||||
@@ -38,4 +41,10 @@ export class ItemSelectComponent implements OnInit {
|
||||
return this.itemSelectService.getSelected(id);
|
||||
}
|
||||
|
||||
confirmSelected() {
|
||||
this.selectedIds$.subscribe((ids: string[]) => {
|
||||
this.confirm.emit(ids);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user