1
我要的只是構建一個簡單的RSS應用程序。該應用程序到目前爲止在瀏覽器上工作正常,但是當我嘗試將此構建到我的手機中時,整個rss部分都消失了。 即時使用離子-yeoman框架上的角度。
我的服務:
'use strict';
angular.module('RedColor.services', [])
.factory('myService', function($http) {
return {
getFoo: function() {
// since $http.get returns a promise,
// and promise.then() also returns a promise
// that resolves to whatever value is returned in it's
// callback argument, we can return that.
return $http.jsonp('//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=50&callback=JSON_CALLBACK&q=http://www.ynet.co.il/Integration/StoryRss1854.xml');
}
}
});
我的控制器:
.controller('PlaylistsCtrl', function(myService,$scope) {
myService.getFoo().then(function(data) {
// this will execute when the
// AJAX call completes.
$scope.playlists = data.data.responseData.feed.entries;
console.log(data);
});
})
我的HTML: