File

projects/maplander/components/src/lib/components/property/components/gallery/gallery.service.ts

Index

Methods

Constructor

constructor(_dialog: MatDialog)
Parameters :
Name Type Optional
_dialog MatDialog No

Methods

Public open
open(multimedia: PFile[], indexSelected?: number, type?: "IMAGE" | "VIDEO" | "SPHERIC")
Parameters :
Name Type Optional
multimedia PFile[] No
indexSelected number Yes
type "IMAGE" | "VIDEO" | "SPHERIC" Yes
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'
    });
  }
}

result-matching ""

    No results matching ""