You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Angular 17.3 and my app is completely standalone, so I don't have any ngModules. I want to use loadImage function to cancel the loading images when user changes the route or tab. I have imported the LazyLoadImageModule into my app component, also I have added the { provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks, deps: [HttpClient] }
to my appConfig providers, I'm using this class
@Injectable()
class LazyLoadImageHooks extends IntersectionObserverHooks {
private http: HttpClient;
constructor(http: HttpClient) {
// You can inject what ever service you want here
super();
this.http = http;
}
loadImage({ imagePath }: Attributes): Observable<string> {
console.log('YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY', imagePath);
return this.http.get(imagePath, { responseType: 'blob' }).pipe(map((blob) => URL.createObjectURL(blob)));
}
}
the console.log never executes.
I tried to add LazyLoadImageModule to appconfig providers using importProvidersFrom( but it doesn't work.
how should I do it.
if you could provide me a simple example using angular standalone and use loadImage to cancel the image load, it would be so nice
The text was updated successfully, but these errors were encountered:
I'm using Angular 17.3 and my app is completely standalone, so I don't have any ngModules. I want to use loadImage function to cancel the loading images when user changes the route or tab. I have imported the LazyLoadImageModule into my app component, also I have added the
{ provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks, deps: [HttpClient] }
to my appConfig providers, I'm using this class
the console.log never executes.
I tried to add LazyLoadImageModule to appconfig providers using importProvidersFrom( but it doesn't work.
how should I do it.
if you could provide me a simple example using angular standalone and use loadImage to cancel the image load, it would be so nice
The text was updated successfully, but these errors were encountered: