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: