ionic-img-viewer
ionic-img-viewer copied to clipboard
lazy loading
Please provide you version information :
| Dependency | Version |
|---|---|
| ionic2 | 3.4.2 |
| angular | 4 |
| ionic-img-viewer |
Have you checked...
- [ ] That npm install returns no warning ?
- [ ] Doing a purge of your node_modules folder ?
Lazy loading is not compatible with the plugin.
What do you mean by lazy loading ? Please provide some more details !
I think what he means is for pages lazy loaded with its ngModules, your directive or component breaks. As of today, with Ionic 3.5.3 it fails to support [email protected] for all loading methods.
try installing it on latest ionic project you will find an error stating:
UNMET PEER DEPENDENCY [email protected] └── [email protected]
I think you need to update it. Its not working for my project.
Great stuff though.
Lazy loading is a new feature introduced in ionic 3 and angular 4. By this, pages can be loaded only when first jump to.
Every page needs to be lazy loading, add a module wrapper to this page. So, to use this component with lazy loading, both import the IonicImageViewerModule into AppModule and the PageModule you used, it will works.
Tried that!!! Doesn't work!!!! Added IonicImageViewerModule to both AppModule and PageModule. No errors, no result, no console log.
Reinstalled it!!! Nothing!!!
Have you tested it recently?
I just did it last night. Maybe you missed something somewhere.
- Add IonicImageViewerModule to AppModule, in app.module.ts
import { IonicImageViewerModule } from 'ionic-img-viewer';
...
@NgModule {
...
imports: [
IonicImageViewerModule, ...
]
}
- Add IonicImageViewerModule to YourPageModule, such as photo-slide.module.ts:
import { IonicImageViewerModule } from 'ionic-img-viewer';
@NgModule({
...
imports: [
IonicImageViewerModule,
IonicPageModule.forChild(PhotoSlidePage)
]
})
- Add imaegViewer attribute to img tag in template file of photo-slide.ts
<img [src]="photo.path" class="photo" imageViewer />
- Enjoy it.
It should work for Base64 image string right? I am using the ImageViewerController but nothing shows up after clicking on the image. Using Ionic 3.5.0
@netsesame2 Also had to do that to get it working. Should have worked it with just adding it to the main app module but who knows...
@biskazz @Riron Same with me. I had expected it to word when only adding it to the page module. Which was sufficient for any other module that I use.
@satveshk works for me. Can you post your code? Have you tried with a jpg, does it work then, but not with Base64?