【发布时间】:2017-01-13 10:38:59
【问题描述】:
这是一个奇怪的问题,控制器循环遍历一个数组,该数组从服务器收集图像的 url,然后将其放入 src="https://www.socialnetwk.com/test.png" 但是它不会加载这些图像。我检查元素,右键单击 src=".." 并在新窗口中打开。一次在新窗口中,我刷新 ionic 应用程序页面,它会加载该图像,该图像只有我
.controller('feedCtrl', function($scope, $http) {
$scope.result = "";
$http.get('https://m.socialnetwk.com/home/app/feed_load.php').then(function(rest) {
$scope.records = rest.data;
});
})
<div ng-repeat="feed in records">
<ion-list id="search-list5">
<ion-item class="item-avatar" id="search-list-item12">
<img src="https://www.socialnetwk.com/media/{{feed.profile_image}}">
<h2>{{feed.firstname}} {{feed.lastname}}</h2>
<p>{{feed.location}}</p>
</ion-item>
</ion-list>
<div style="margin: 0px; line-height: 250px; background-color: rgb(232, 235, 239); text-align: center;">
<img style="width:100%;height:auto;" ng-src="https://www.socialnetwk.com/media/{{feed.media_file_format}}/{{feed.media_post_id}}{{feed.media_author_id}}.{{feed.media_file_format}}" />
</div>
<div class="item item-body" id="search-list-item-container3">
<div id="search-markdown6" class="show-list-numbers-and-dots">
<p style="margin-top:0px;color:#000000;">{{feed.mediatxt}}
</p>
</div>
</div>
</div>
【问题讨论】:
-
请在问题中添加您的 html 代码