capacitor-community / photoviewer

⚡ Capacitor plugin to view table images with fullscreen and sharing capabilities.
MIT License
52 stars 25 forks source link

photoviewer in pwa not open image #16

Closed ivanov84 closed 2 years ago

ivanov84 commented 2 years ago

Describe the bug photoviewer in pwa not open image

To Reproduce Steps to reproduce the behavior:

  1. installed npm install --save-dev jeep-photoviewer@latest
  2. tryed to open image with code:
    const capImage: Image = {url: url, title: '_'};
    const viewerOptions: ViewerOptions = {share: true, title: false};
    const capOptions: capShowOptions = {images: [capImage], mode:'one', startFrom: 0, options: viewerOptions };
    await PhotoViewer.show(capOptions);
  3. See error: ERROR Error: Uncaught (in promise): Div id='photoviewer-container' not found

Expected behavior open image

Desktop (please complete the following information):

jepiqueau commented 2 years ago

@ivanov84 in your html or your component surround the jeep-photoviewer with a div having an id= photoviewer-container

ivanov84 commented 2 years ago

@jepiqueau thank you a lot. I added code and all worked for me:

<body>
    <div id='photoviewer-container'>
        <app-root></app-root>
    </div>
</body>