File
Constructor
constructor(_dialog: MatDialog)
|
|
Parameters :
Name |
Type |
Optional |
_dialog |
MatDialog
|
No
|
|
Methods
open
|
open(currentType: PFileTypeEnum, multimedia?: PFile[], newMedia?: UserMedia[])
|
|
Parameters :
Name |
Type |
Optional |
currentType |
PFileTypeEnum
|
No
|
multimedia |
PFile[]
|
Yes
|
newMedia |
UserMedia[]
|
Yes
|
|
import {Injectable} from '@angular/core';
import {MatDialog, MatDialogRef} from '@angular/material/dialog';
import {PFile, PFileTypeEnum, UserMedia} from '@maplander/types';
import {MultimediaUploaderComponent} from './multimedia-uploader.component';
@Injectable()
export class MultimediaUploaderService {
constructor(
private _dialog: MatDialog
) {
}
open(currentType: PFileTypeEnum, multimedia?: PFile[], newMedia?: UserMedia[]): MatDialogRef<MultimediaUploaderComponent> {
return this._dialog.open<MultimediaUploaderComponent, {currentType: PFileTypeEnum, multimedia: PFile[], newMedia: UserMedia[]},
{currentType: PFileTypeEnum, multimedia: PFile[], newMedia: UserMedia[]}>
(MultimediaUploaderComponent, {
data: {currentType: currentType || PFileTypeEnum.IMAGE, multimedia: multimedia || [], newMedia: newMedia || []},
panelClass: 'multimedia-uploader-panel-class',
disableClose: true
});
}
}