Hi guys im trying to set up an rss feed through angular and i get this error "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: feed in feedSrc, Duplicate key: string:t, Duplicate value: t".Can you please check the code below and tell where im going wrong,or if you can point me in the right direction of how to set this up.
here is my angular code
var Search = angular.module('searchApp', ['ngMaterial', 'ngMessages']);
Search.controller("FeedCtrl", ['$scope','FeedService', function ($scope,Feed) {
// $scope.loadButonText="Load";
$scope.feedSrc= "http://rss.cnn.com/rss/edition_sport.rss";
$scope.loadFeed=function(e){
Feed.parseFeed($scope.feedSrc).then(function(res){
$scope.loadButonText=angular.element(e.target).text();
$scope.feeds=res.data.responseData.feed.entries;
});
}
}]);
Search.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));
}
}
}]);
Here is my html code
<md-content class="md-padding">
<h1 class="md-display-2">Articles</h1>
<md-list ng-controller="FeedCtrl">
<md-list-item class="md-3-line" ng-repeat="feed in feedSrc" style="margin-bottom:20px;">
<img ng-src="{{feed.image}}" class="face" style="padding-right:20px;">
<div class="md-list-item-text">
<h3>{{feed.title}}</h3>
<h4>{{feed.pubDate}}</h4>
<p>{{feed.teaser}}</p>
</div>
<md-button class="md-accent">Read more</md-button>
<md-divider ng-if="!$last"></md-divider>
</md-list-item>
</md-list>
</md-content>