简体   繁体   中英

Display image in AngularJS

Not sure why my image's aren't being loaded by angular, here's what I've got:

<li class="list-group-item" ng-repeat="family in product.families | orderBy:'category'">
    <h3>{{family.category}}</h3>
    <div class="img-wrap">
        <img ng-src="{{family.image}}"/>
    </div>
</li>

family.category works, but my ng-src does not seem to be. When I look in the HTML of the loaded page all I see is <img ng-src>

JSON Sytnax

"families": [
    {
      "category": "Tablets",
      "image": "images/tablet.png"
    }
]

You can take a look at the live version of this here

Make sure image url is correct, try complete image url in json.

In chrome dev tools-> network check which url it in invoking.

--

I have low reputation can't comment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM