projects/maplander/components/src/lib/components/property/components/gallery/gallery.service.ts
Methods |
|
constructor(_dialog: MatDialog)
|
||||||
Parameters :
|
Public open | ||||||||||||
open(multimedia: PFile[], indexSelected?: number, type?: "IMAGE" | "VIDEO" | "SPHERIC")
|
||||||||||||
Parameters :
Returns :
MatDialogRef<GalleryComponent>
|
import {Injectable} from '@angular/core';
import {MatDialog, MatDialogRef} from '@angular/material/dialog';
import {PFile} from '@maplander/types';
import {GalleryComponent} from './gallery.component';
export interface GalleryConfig {
multimedia: PFile[];
indexSelected: number;
type: 'IMAGE' | 'VIDEO' | 'SPHERIC';
}
@Injectable()
export class GalleryService {
constructor(
private _dialog: MatDialog
) {
}
public open(multimedia: PFile[], indexSelected?: number, type?: 'IMAGE' | 'VIDEO' | 'SPHERIC'): MatDialogRef<GalleryComponent> {
return this._dialog.open<GalleryComponent, GalleryConfig>(
GalleryComponent, {
data: {
multimedia: multimedia || [],
indexSelected: indexSelected || 0,
type: type || null
},
disableClose: true,
panelClass: 'gallery_dialog'
});
}
}