55693: emit only once and reset selected items + notification

This commit is contained in:
Kristof De Langhe
2018-09-27 11:46:26 +02:00
parent 09a84edb09
commit ce134bbd10
2 changed files with 12 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import { Observable } from 'rxjs/Observable';
import { Item } from '../../core/shared/item.model';
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
import { ItemSelectService } from './item-select.service';
import { take } from 'rxjs/operators';
@Component({
selector: 'ds-item-select',
@@ -42,8 +43,11 @@ export class ItemSelectComponent implements OnInit {
}
confirmSelected() {
this.selectedIds$.subscribe((ids: string[]) => {
this.selectedIds$.pipe(
take(1)
).subscribe((ids: string[]) => {
this.confirm.emit(ids);
this.itemSelectService.reset();
});
}