Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding imageViewer to the img tag does not work #117

Open
Shivani-Parihar opened this issue Apr 12, 2018 · 3 comments
Open

adding imageViewer to the img tag does not work #117

Shivani-Parihar opened this issue Apr 12, 2018 · 3 comments

Comments

@Shivani-Parihar
Copy link

Shivani-Parihar commented Apr 12, 2018

Please provide you version information :

Dependency Version
ionic2 3.18.0
angular 5.2.9
ionic-img-viewer 2.9.0

I was able to get it working with creating my own instance of imageViewer

<img src="assets/imgs/bilirubin.png" #myImage (click)="zoomImage(myImage)" />
zoomImage(myImage) {
    const imageViewer = this._imageViewerCtrl.create(myImage);
    imageViewer.present();
    console.log(myImage);

    setTimeout(() => imageViewer.dismiss(), 5000);
  }

But as my app works, I have to get it working with just adding the imageViewer to img tag which does not work.
Can you help out with why the below method does not work

<img src="assets/imgs/bilirubin.png" imageViewer />
@Bleno
Copy link

Bleno commented Apr 14, 2018

+1

@Riron
Copy link
Owner

Riron commented May 28, 2018

Hey,
Do you have any error in the console ?

@kamran377
Copy link

kamran377 commented May 31, 2018

Add the IonicImageViewerModule to your page' smodule.ts like this

import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { DemoPhotoShootPage } from './demo-photo-shoot';
import { TranslateModule } from '@ngx-translate/core';

import { IonicImageViewerModule } from 'ionic-img-viewer';
@NgModule({
  declarations: [
    DemoPhotoShootPage,
  ],
  imports: [
    IonicPageModule.forChild(DemoPhotoShootPage),
	TranslateModule.forChild(),
	IonicImageViewerModule,
  ],
})
export class DemoPhotoShootPageModule {}

After this it works fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants