# Cannot resolve image path \[SOLVED\]

**URL:** <https://forum.ionicframework.com/t/cannot-resolve-image-path-solved/40854>\
**Category:** ionic-v1\
**Created:** [January 9, 2016, 2:15pm UTC](https://forum.ionicframework.com/t/cannot-resolve-image-path-solved/40854 "2016-01-09T14:15:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justsid](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@justsid](https://forum.ionicframework.com/u/justsid)\
**Post date:** [January 9, 2016, 2:15pm UTC](https://forum.ionicframework.com/t/cannot-resolve-image-path-solved/40854/1 "2016-01-09T14:15:00Z")

</div>

So i have been trying out ionic, i was going through a tutorial to create a controller, open a JSON file and some images in controller and send the data to view. I can open the file alright (console.logged), but for some reason it cannot access the images, throws an error.

> GET [http://localhost:8100/img/{{item.shortname}}\_tn.jpg](http://localhost:8100/img/%7B%7Bitem.shortname%7D%7D_tn.jpg) 404 (Not Found)

Name of the image file is same as short name of person in json file, which is why {{item.shortname}}\_tn.jpg is used.

angular part goes something like this

`

  
  
  
  
  

```
  <ion-content class="has-subheader" ng-controller="ListController">
    <ion-list>
      <ion-item ng-repeat='item in artists' class="item-thumbnail-left item-text-wrap">
        <img src="img/{{item.shortname}}_tn.jpg" alt="{{item.name}} Photo">
        <h2>{{item.name}}</h2>
        <h2>{{item.reknown}}</h2>
        <h2>{{item.bio}}</h2>
      </ion-item>
    </ion-list>
  </ion-content>
</ion-pane>`

```

Controller is as follows

`.controller('ListController',['$scope', '$http', function($scope, $http) { $http.get('js/data.json').success(function(data){ $scope.artists = data.artists; console.log(data.artists); }); }]);`

I’ve tried to checkout a new project third time, and the same mistake. No luck. One more guy had a problem similar to this, but he had two different objects coming in. In my case, it says resource not found, and if i comment that line out, i get no errors, but NO output either. Ionic reads the file, dumps the data on the console, but does not print it where i want it printed (in the webpage, not the console).

> [@Error, status 404 in Ionic and Angular](https://forum.ionicframework.com/t/error-status-404-in-ionic-and-angular/31196):
>
> I’m new, and starting to code one application using Ionic, but i have a kind of issue or error. //Mycode .controller('ListController', ['$scope', '$http', function($scope, $http) { $http.get('js/data.json').success( function(data){ $scope.artists = data; }); }]); and I have this error http://localhost:8100/img/%7B%7Bitem.shortname%7D%7D\_tn.jpg Failed to load resource: the server responded with a status of 404 (Not Found) what kind of error is this? I’m running my app…

I’m thinking it might be a typo, or i’m following an old tutorial and newer versions might have a different way of doing things. Can anyone give me any leads to solve this? Thanks…

1. List item

---

<div class="post-metadata">

**Author:** ![justsid](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@justsid](https://forum.ionicframework.com/u/justsid)\
**Post date:** [January 9, 2016, 2:39pm UTC](https://forum.ionicframework.com/t/cannot-resolve-image-path-solved/40854/2 "2016-01-09T14:39:46Z")

</div>

problem seemed to be lurking at the one place i did not look.  
data.json file had JSON elements under a “speakers” parent, whereas in the tutorial the data did not have any parent.  
so instead of  
`$scope.artists = data.artists;`  
I used  
`$scope.artists = data.speakers;`

And Voila, up and running.

I think it might be helpful for some people in the future.

---

<div class="post-metadata">

**Author:** ![fagianijunior](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/fagianijunior/32/116965_2.png) [@fagianijunior](https://forum.ionicframework.com/u/fagianijunior)\
**Post date:** [September 25, 2017, 8:53pm UTC](https://forum.ionicframework.com/t/cannot-resolve-image-path-solved/40854/3 "2017-09-25T20:53:33Z")

</div>

Info: In angularJs use ng-src="" instead src=""
