# Ionic-image-loader plugin not working

**URL:** <https://forum.ionicframework.com/t/ionic-image-loader-plugin-not-working/127359>\
**Category:** ionic-v3\
**Created:** [April 9, 2018, 12:30pm UTC](https://forum.ionicframework.com/t/ionic-image-loader-plugin-not-working/127359 "2018-04-09T12:30:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fieel](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/fieel/32/118047_2.png) [@Fieel](https://forum.ionicframework.com/u/Fieel)\
**Post date:** [April 9, 2018, 12:30pm UTC](https://forum.ionicframework.com/t/ionic-image-loader-plugin-not-working/127359/1 "2018-04-09T12:30:01Z")

</div>

Hello,

i’ve been following some Ionic classes at school lately. We never used .module.ts files with our page, just app.module.ts, so when the command ionic generate page started creating .module.ts files i freaked out, googled and found out i could avoid this using the --no-module parameter.

Well, turns out, those modules are quite useful. I wanted to add an image caching plugin (see [https://www.npmjs.com/package/ionic-image-loader](https://www.npmjs.com/package/ionic-image-loader) ) and this plugin requires specifically this:

_Then add IonicImageLoader in your child/shared module(s)_

which of course i’m lacking. I have no idea how to even install this plugin now. What can i possibly do?

**I’m using Ionic 3.20.0**

---

<div class="post-metadata">

**Author:** ![Fieel](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/fieel/32/118047_2.png) [@Fieel](https://forum.ionicframework.com/u/Fieel)\
**Post date:** [April 9, 2018, 12:56pm UTC](https://forum.ionicframework.com/t/ionic-image-loader-plugin-not-working/127359/2 "2018-04-09T12:56:39Z")

</div>

cli packages: (C:\Users\Fil\AppData\Roaming\npm\node\_modules)

```
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0

```

global packages:

```
cordova (Cordova CLI) : 8.0.0

```

local packages:

```
@ionic/app-scripts : 3.1.8
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2

```

System:

```
Android SDK Tools : 26.1.1
Node : v8.9.4
npm : 5.6.0
OS : Windows 10

```

Environment Variables:

```
ANDROID_HOME : C:\android_sdk

```

Misc:

```
backend : pro
```

---

<div class="post-metadata">

**Author:** ![SigmundFroyd](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sigmundfroyd/32/111604_2.png) [@SigmundFroyd](https://forum.ionicframework.com/u/SigmundFroyd)\
**Post date:** [April 9, 2018, 2:24pm UTC](https://forum.ionicframework.com/t/ionic-image-loader-plugin-not-working/127359/3 "2018-04-09T14:24:34Z")

</div>

I don’t believe the plugin requires child/shared modules, it just provides that step for those who use them.

With this in mind, I _believe_ all you need is that initial import in `app.module.ts`

If you want to add lazy loading though, you’ll have to manually create the .module.ts files.

---

<div class="post-metadata">

**Author:** ![Fieel](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/fieel/32/118047_2.png) [@Fieel](https://forum.ionicframework.com/u/Fieel)\
**Post date:** [April 9, 2018, 4:13pm UTC](https://forum.ionicframework.com/t/ionic-image-loader-plugin-not-working/127359/4 "2018-04-09T16:13:45Z")

</div>

The plugin doesn’t seem to work without so i figured it’s a must

imported in app.module.ts:

```auto
import { IonicImageLoader } from 'ionic-image-loader';

...

    imports: [
        ...,
        IonicImageLoader.forRoot()

```

No errors and such. Then i simply use it in whatever page i want, like this:

```auto
<img-loader src="http://marrowproductions.com/WoF/wiki/images/a/a9/Example.jpg"></img-loader>

```

but it’s not rendering at all, if i inspect i find this newly edited tag:

```auto
<img-loader src="http://marrowproductions.com/WoF/wiki/images/a/a9/Example.jpg" _nghost-c0="" ng-reflect-src="http://marrowproductions.com/W" style="display: block; height: 100%; width: 100%; background-size: contain; background-repeat: no-repeat; background-image: url(&quot;http://marrowproductions.com/WoF/wiki/images/a/a9/Example.jpg&quot;);">
<!--bindings={ "ng-reflect-ng-if": "false"}-->
</img-loader>

```

It’s working, i’m so noob i didn’t even realize it was working. My markup was bad so the image wasn’t rendering properly. Here’s my new html markup:

```auto
<div *ngIf="data.media_type == 'image'" (click)="showFullScreenImage(data.hdurl)" class="stile-immagine">
    <img-loader src="{{ data.url }}" useImg></img-loader>
</div>

```

`<img-loader>` without the useImg proprety wouldn’t render at all.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:41pm UTC](https://forum.ionicframework.com/t/ionic-image-loader-plugin-not-working/127359/5 "2021-07-19T21:41:18Z")

</div>

Closed on July 19, 2021, 9:41pm UTC


