|
@@ -92,8 +92,14 @@ app.controller('main', function($scope,$http,$sce) {
|
|
|
function(data) {
|
|
function(data) {
|
|
|
if(page==undefined)
|
|
if(page==undefined)
|
|
|
$scope.curPage=1;
|
|
$scope.curPage=1;
|
|
|
- //$scope.news=#data.data.articles.map(function(el) { el.scrap_date=Date(el.scrap_date); return el; });
|
|
|
|
|
- $scope.news=data.data.articles;
|
|
|
|
|
|
|
+ $scope.news=data.data.articles.map(
|
|
|
|
|
+ function(el) {
|
|
|
|
|
+ el.kw=el.kw.filter(function(item, pos) {
|
|
|
|
|
+ return el.kw.indexOf(item) == pos;
|
|
|
|
|
+ });
|
|
|
|
|
+ return el;
|
|
|
|
|
+ });
|
|
|
|
|
+ //$scope.news=data.data.articles;
|
|
|
$scope.totPages=Math.ceil(data.data.count/itemsPerPage);
|
|
$scope.totPages=Math.ceil(data.data.count/itemsPerPage);
|
|
|
},
|
|
},
|
|
|
function(data) {
|
|
function(data) {
|