Skip to content

Instantly share code, notes, and snippets.

@kkga
Created January 24, 2014 14:59
Show Gist options
  • Save kkga/8598848 to your computer and use it in GitHub Desktop.
Save kkga/8598848 to your computer and use it in GitHub Desktop.
goodMorning
'use strict';
var app = angular.module('goodMorning', []);
var feedList = [ "http://news.layervault.com/?format=rss", "https://news.ycombinator.com/rss" ];
app.controller("FeedCtrl", ['$scope','FeedService', function ($scope,Feed) {
$scope.showFeeds = function() {
};
$scope.loadFeed = function() {
Feed.parseFeed(feedSrc).then(function(res){
$scope.entries=res.data.responseData.feed.entries;
$scope.feedTitle=res.data.responseData.feed.title;
});
}()
}]);
app.factory('FeedService',['$http',function($http){
return {
parseFeed : function(url){
return $http.jsonp('//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=50&callback=JSON_CALLBACK&q=' + encodeURIComponent(url));
}
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment