tjoskar/ng-lazyload-image

Can't bind to 'defaultImage' since it isn't a known property of 'img'.

anup5708 opened this issue · 4 comments

Hi Team,

I am still facing the same issue.

Below are the details of my package.json

  "@ionic/angular": "^5.5.2",
"@angular/core": "~12.1.1",
"ng-lazyload-image": "^9.1.0",

app.module.ts

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    AngularFireModule.initializeApp(environment.firebaseapp),
    AngularFireDatabaseModule,
    LazyLoadImageModule,
  ],
  providers: [
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
    AngularFirestore,
    Globals,
  ],
  bootstrap: [AppComponent],
})

HTML


  <ion-slide *ngFor="let image of slidingImage;">
          <ion-card >
            <img
              [defaultImage]="global.loading"
              [lazyLoad]="image .url"
            />
          </ion-card>
        </ion-slide>

Added below code also but doesn't work as well

providers: [{ provide: LAZYLOAD_IMAGE_HOOKS, useClass: ScrollHooks }],

Please assist if I am doing anything wrong.
error

I can't see anything wrong here. Is it possible for you to create a small repo where you can reproduce the issue?

bamma commented

@anup5708 Seing that this is a ionic app, I am assuming you are lazy loading pages, hence you need to import it in that feature module

I'm closing this. Let me know it this is still an issue