Angularjs用ng-src获取不到图片地址
用Angularjs写前端,其他数据都读到了,用浏览器控制台看,变量也传到了,但是就是无法正常显示图片,web端显示ng-src=“”,没读取到地址前端代码<trng-r...
用Angularjs写前端,其他数据都读到了,用浏览器控制台看,变量也传到了,但是就是无法正常显示图片,web端显示ng-src=“”,没读取到地址
前端代码
<tr ng-repeat="item in items">
<td>
<span ng-bind="item['id']"></span>
</td>
<td>
<span ng-bind="item['name']"></span>
</td>
<td>
<span ng-bind="item['type']"></span>
</td>
<td>
<span ng-if="item['app'] == 'app封面'" ng-bind="item['app']"></span>
<img ng-if="item['app'] != 'app封面'" ng-src="{{ item.app }}" ng-bind="item['app']" style="width: 50px; height: 50px">
<img ng-src="{{ item.app }}">
</td>
<td>
<span ng-if="item['web'] == 'web封面'" ng-bind="item['web']"></span>
<img ng-if="item['web'] != 'web封面'" ng-src="{{ item.web }}" ng-bind="item['web']" style="width: 50px; height: 50px">
</td>
</tr>
页面显示,ng-src没读到地址
<img ng-if="item['app'] != 'app封面'" ng-src="" class="ng-scope"> 展开
前端代码
<tr ng-repeat="item in items">
<td>
<span ng-bind="item['id']"></span>
</td>
<td>
<span ng-bind="item['name']"></span>
</td>
<td>
<span ng-bind="item['type']"></span>
</td>
<td>
<span ng-if="item['app'] == 'app封面'" ng-bind="item['app']"></span>
<img ng-if="item['app'] != 'app封面'" ng-src="{{ item.app }}" ng-bind="item['app']" style="width: 50px; height: 50px">
<img ng-src="{{ item.app }}">
</td>
<td>
<span ng-if="item['web'] == 'web封面'" ng-bind="item['web']"></span>
<img ng-if="item['web'] != 'web封面'" ng-src="{{ item.web }}" ng-bind="item['web']" style="width: 50px; height: 50px">
</td>
</tr>
页面显示,ng-src没读到地址
<img ng-if="item['app'] != 'app封面'" ng-src="" class="ng-scope"> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询