# Inserting image into ionic2 dynamically

**URL:** <https://forum.ionicframework.com/t/inserting-image-into-ionic2-dynamically/77024>\
**Category:** ionic-v3\
**Created:** [January 22, 2017, 5:12pm UTC](https://forum.ionicframework.com/t/inserting-image-into-ionic2-dynamically/77024 "2017-01-22T17:12:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikneke](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@vikneke](https://forum.ionicframework.com/u/vikneke)\
**Post date:** [January 22, 2017, 5:12pm UTC](https://forum.ionicframework.com/t/inserting-image-into-ionic2-dynamically/77024/1 "2017-01-22T17:12:02Z")

</div>

I am trying to add png files to my applications. However, keep getting 404 error content not found. By this time, I have tried many ways but none successful;

If I use the following, I only get “?” mark instead of an image and 404 error.

`<img [src]="'assets/img/measure-img/' +'question.image'"/>`

They have to be inserted dynamically, therefore, in html and not scss file.

Anyone having the same issue?

---

<div class="post-metadata">

**Author:** ![ankushagg93](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ankushagg93/32/103254_2.png) [@ankushagg93](https://forum.ionicframework.com/u/ankushagg93)\
**Post date:** [January 22, 2017, 5:35pm UTC](https://forum.ionicframework.com/t/inserting-image-into-ionic2-dynamically/77024/2 "2017-01-22T17:35:13Z")

</div>

See working example in my repo

[https://github.com/aggarwalankush/ionic2-mosum/blob/master/src/pages/template/weather-list.template.html#L27-L28](https://github.com/aggarwalankush/ionic2-mosum/blob/master/src/pages/template/weather-list.template.html#L27-L28)

[https://github.com/aggarwalankush/ionic2-mosum/blob/master/src/pages/providers/util.service.ts#L113-L119](https://github.com/aggarwalankush/ionic2-mosum/blob/master/src/pages/providers/util.service.ts#L113-L119)

and image in assets folder

[https://github.com/aggarwalankush/ionic2-mosum/blob/master/src/assets/img/sunrise.png](https://github.com/aggarwalankush/ionic2-mosum/blob/master/src/assets/img/sunrise.png)

---

<div class="post-metadata">

**Author:** ![vikneke](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@vikneke](https://forum.ionicframework.com/u/vikneke)\
**Post date:** [January 22, 2017, 10:11pm UTC](https://forum.ionicframework.com/t/inserting-image-into-ionic2-dynamically/77024/3 "2017-01-22T22:11:57Z")

</div>

Many thanks! Made it work.

---

<div class="post-metadata">

**Author:** ![kierandes](https://avatars.discourse-cdn.com/v4/letter/k/4491bb/32.png) [@kierandes](https://forum.ionicframework.com/u/kierandes)\
**Post date:** [March 8, 2018, 9:31am UTC](https://forum.ionicframework.com/t/inserting-image-into-ionic2-dynamically/77024/4 "2018-03-08T09:31:48Z")

</div>

Any more examples somewhere? Having a similar issue :). Thanks

---

<div class="post-metadata">

**Author:** ![ankushagg93](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ankushagg93/32/103254_2.png) [@ankushagg93](https://forum.ionicframework.com/u/ankushagg93)\
**Post date:** [April 8, 2018, 6:11am UTC](https://forum.ionicframework.com/t/inserting-image-into-ionic2-dynamically/77024/5 "2018-04-08T06:11:01Z")

</div>

@kierandes Updated links below

> <https://github.com/aggarwalankush/ionic-mosum/blob/master/src/components/weather-list/weather-list.html#L27-L28>

> <https://github.com/aggarwalankush/ionic-mosum/blob/master/src/providers/util.service.ts#L113>

and images in assets folder

> **[aggarwalankush/ionic-mosum](https://github.com/aggarwalankush/ionic-mosum/tree/master/src/assets/img)**
>
> ionic-mosum - Download Latest Ionic v3 Weather App -\>
