Hello, I am trying to get lazyLoad to work on my Ionic 4 app. I have imported it on my app.module.ts, and are trying to use it on my page. I’m not sure what the issue is and any help is greatly appreciated.
app.module.ts
import { LazyLoadImageModule, intersectionObserverPreset } from 'ng-lazyload-image'; @NgModule({ declarations: [AppComponent], entryComponents: [], imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, HttpClientModule, IonicStorageModule.forRoot(),LazyLoadImageModule.forRoot({preset: intersectionObserverPreset})], providers: [ StatusBar, SplashScreen, Insomnia, { provide: RouteReuseStrategy, useClass: IonicRouteStrategy } ], bootstrap: [AppComponent] }) export class AppModule {}
my page.html
<ion-col size="2" *ngFor="let movie of browseResults| keyvalue"> <div class="rating">☆ {{movie.value.rating}}</div> <img (click)="movieDetails(movie.value.stream_id)" (keyup.enter)="movieDetails(movie.value.stream_id)" [lazyLoad]="movie.value.stream_icon" class="browse-image focusable"> </ion-col>
And im importing it on the component.ts for this page but not sure what else to do. Its not really being used on the component.