我剛剛瞭解離子。 u能幫助我這個問題, 不知何故,我不能顯示在android系統如何使用離子框架顯示來自RSS feed的圖像
圖片我用這個js代碼從RSS訂閱
.controller("feedCtrl", function($http, $scope){$scope.init = function(){
$http.get("http://ajax.googleapis.com/ajax/services/feed/load", { params: { "v": "1.0", "num":"100", "q": "http://www.bola.net/feed/" } })
.success(function(data) {
$scope.rssTitle = data.responseData.feed.title;
$scope.rssUrl = data.responseData.feed.feedUrl;
$scope.rssSiteUrl = data.responseData.feed.link;
$scope.entries = data.responseData.feed.entries;
// $scope.author = data.responseData.feed.author;
// $scope.descriptionin = data.responseData.feed.description;
//$scope.publishedDate = data.responseData.feed.publishedDate;
//$scope.content = data.responseData.feed.content;
//$scope.categories = data.responseData.feed.categories;
})
.error(function(data) {
console.log("ERROR: " + data);
});} $scope.browse = function(v){
window.open(v, "_system", "location=yes")}});
在我看來,我使用此代碼獲取數據,
<ion-content class="padding" ng-controller="feedCtrl" ng-init="init()">
<div class="list">
<a class="item" ng-href="{{entry.link}}" ng-click="window.open(this.href, '_blank', 'location=no'); return false;" ng-repeat="entry in entries">
<b>{{entry.title}}</b><br/>
<b>{{entry.link}}</b><br/>
<b>{{entry.author}}</b><br/>
<b>{{entry.publishedDate}}</b><br/>
<b>{{entry.contentSnippet}}</b><br/>
<b>{{entry.content}}</b><br/>
<span ng-bind-html="entry.contentSnippet"></span>
</a>
</div>
</ion-content>
在Android的頁面輸入內容的結果是這樣的,
<img src="http://cdn.klimg.com/****.net/library/upload/20/2016/07/175/jose-mourinho_30eb505.jpg" align="left" hspace="5" width="100"/>Pelatih Manchester United Jose Mourinho mengungkapkan pasukannya sudah siap untuk menjalani laga menghadapi Galatasaray yang akan berlangsung di Gothenburg, Swedia, pada hari Sabtu (30/7).]]>
但我想要的是圖像的只是鏈接,
http://cdn.klimg.com/****.net/library/upload/20/2016/07/175/jose-mourinho_30eb505.jpg
我怎樣才能做到這一點? 感謝
哎@Akis ,我試過但結果相同。 –
@windysinaga我已經更新了我的答案,這將肯定有效 – Akis