I'm trying to get the RSS feeds from a link. The ng-click function getNews("SomeText") is working, I have confirmed it with filling a container with some text. However, $http.get() is not working. I only want to show the data for now, I'll parse it later.
Here is my Angular JS code.
var app = angular.module("app",[]);
app.controller("newsController", function($scope, $http) {
$scope.getNews = function(topic) {
if (topic === "NAmerica") {
//The program enters this part, I have confirmed, only $http.get() doesn't work
$http.get('http://www.usnews.com/rss/education')
.then(function (response) {
$scope.message = response;
});
}
};
});
My HTML file has this structure:
<html ng-app="app">
<body ng-controller="newsContainer">
<a href="#" id="NAmerica" ng-click="getNews('NAmerica')">US & Canada</a>
<p> {{message}} </p>
</body>
</html>
response.data.XMLHttpRequest cannot load http://www.usnews.com/rss/education?_=1449166602671. No 'Access-Control-Allow-Origin'Edit: Also, typo on controller name, as mentioned above.http://www.usnews.com/rss/educationis not a Restful API. If you try to do agetrequest on Postman, it returns you some XML stuff.