Created
January 24, 2014 14:59
-
-
Save kkga/8598848 to your computer and use it in GitHub Desktop.
goodMorning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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