asset-picker-dialog-component.md 3.8 KB


title: "AssetPickerDialogComponent" isDefaultIndex: false

generated: true

import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription';

AssetPickerDialogComponent

A dialog which allows the creation and selection of assets.

Example

selectAssets() {
  this.modalService
    .fromComponent(AssetPickerDialogComponent, {
        size: 'xl',
    })
    .subscribe(result => {
        if (result && result.length) {
            // ...
        }
    });
}
class AssetPickerDialogComponent implements OnInit, AfterViewInit, OnDestroy, Dialog<Asset[]> {
    assets$: Observable<AssetLike[]>;
    allTags$: Observable<TagFragment[]>;
    paginationConfig: PaginationInstance = {
        currentPage: 1,
        itemsPerPage: 25,
        totalItems: 1,
    };
    multiSelect = true;
    initialTags: string[] = [];
    resolveWith: (result?: Asset[]) => void;
    selection: Asset[] = [];
    searchTerm$ = new BehaviorSubject<string | undefined>(undefined);
    filterByTags$ = new BehaviorSubject<TagFragment[] | undefined>(undefined);
    uploading = false;
    constructor(dataService: DataService, notificationService: NotificationService)
    ngOnInit() => ;
    ngAfterViewInit() => ;
    ngOnDestroy() => void;
    pageChange(page: number) => ;
    itemsPerPageChange(itemsPerPage: number) => ;
    cancel() => ;
    select() => ;
    createAssets(files: File[]) => ;
}
  • Implements: OnInit, AfterViewInit, OnDestroy, Dialog<Asset[]>
### assets$ ### allTags$ ### paginationConfig ### multiSelect ### initialTags ### resolveWith Asset[]) => void`} /> ### selection Asset[]`} /> ### searchTerm$ ### filterByTags$ ### uploading ### constructor DataService, notificationService: NotificationService) => AssetPickerDialogComponent`} /> ### ngOnInit `} /> ### ngAfterViewInit `} /> ### ngOnDestroy void`} /> ### pageChange `} /> ### itemsPerPageChange `} /> ### cancel `} /> ### select `} /> ### createAssets `} />