[英]Angular JS XML data display issue
I'm trying to learn Xml and AngularJs, and I have some issues. 我正在尝试学习Xml和AngularJs,但遇到了一些问题。 I am not able to display the img tag of my feed, well i suppose it's enclosure tag but it does'nt work.
我无法显示供稿的img标签,我想它是附件标签,但是不起作用。 For the title or description there's no problems
对于标题或描述没有问题
Anyone knows how I can fix it ? 有人知道我该如何解决吗?
Thanks a lot and here goes my code! 非常感谢,这是我的代码!
<tr ng-repeat="item in feed.entries | filter:searchText">
<td>
<img ng-src="{{item.enclosure}}" />
</td>
<td>
<a href="#/feed/{{feed.id}}/item/{{item.title|hash}}">
<strong ng-bind-html="item.title"></strong>
</a>
<br/>
<span ng-bind-html="item.contentSnippet"></span>
</td>
<td>
{{item.publishedDate | rssDate}}
</td>
</tr>
You have to take the attribute url
of your enclosure
tag. 您必须使用
enclosure
标签的属性url
。 Try: 尝试:
<img ng-src="{{item.enclosure._url}}" />
<item><title>Foot - LFP - LFP : l'UCPF demande la démission de Frédéric Thiriez</title><link>http://www.lequipe.fr/Football/Actualites/Lfp-l-ucpf-le-syndicat-des-clubs-de-l2-demande-la-demission-de-frederic-thiriez/617436#xtor=RSS-1</link><description>L'Assemblée générale de la Ligue, fin février, s'annonce délicate pour son président, Frédéric Thiriez : l'UCPF, l'un des deux syndicats de clubs, estime qu'il «a failli à sa mission» et appelle à sa démission.</description><pubDate>Thu, 17 Dec 2015 14:24:00 +0100</pubDate><enclosure url="http://medias.lequipe.fr/img-photo-jpg/lfp-l-ucpf-le-syndicat-des-clubs-de-l2-demande-la-da-mission-de-fra-da-ric-thiriez/1500000000624930/0-600-0-70/2983b.jpg" length="50000" type="image/jpeg"/></item>
I am not sure if you want to use Image SRC Tag or a Link HREF Tag. 我不确定是否要使用图像SRC标签或链接HREF标签。 I can only see HREF Tag on your Script.
我只能在脚本上看到HREF标签。
For HREF use this: 对于HREF,请使用以下命令:
<a ng-href="#/feed/{{feed.id}}/item/{{item.title|hash}}"></a>
For SRC use this: 对于SRC,请使用以下命令:
<img ng-src="{{SOMETHING.LIKETHIS}}">
Best of Luck. 祝你好运。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.