'use strict';

//@ngInclude
let NpdcShowController = function($scope, npdcAppConfig) {
  $scope.options = npdcAppConfig;
};

module.exports = NpdcShowController;

@@ -62,16 +62,23 @@
 ($scope,
+ $http,
  npdcApp
@@ -87,12 +87,32 @@
 nfig
+, NpolarApiResource
 ) %7B%0A
+%0A
   $s
@@ -141,16 +141,857 @@
 Config;%0A
+  $scope.latest=%5B%5D;%0A%0A  let x = %5B%0A    %7B path: '/dataset'     , params: %7B 'not-draft': 'yes' %7D %7D ,%0A    %7B path: '/map/archive' , params: %7B 'not-draft': 'yes' %7D %7D ,%0A    %7B path: '/expedition'  , params: %7B 'not-draft': 'yes' %7D %7D ,%0A    %7B path: '/publication' , params: %7B 'not-draft': 'yes' %7D %7D ,%0A    %7B path: '/project'     , params: %7B 'not-draft': 'yes' %7D %7D ,%0A    %7B path: '/expedition'  , params:%7B%7D%7D%0A  %5D;%0A%0A  let resourceFactory = function(path) %7B%0A    let service = %7B path %7D;%0A    return NpolarApiResource.resource(service);%0A  %7D;%0A%0A  const limit = 5;%0A  let params = %7B limit, sort: '-created' %7D;%0A%0A  let fetchLatest = function() %7B%0A    x.forEach(r =%3E %7B%0A      let R = resourceFactory(r.path);%0A      R.array(Object.assign(params, r.params), response =%3E %7B%0A        $scope.latest%5Br.path.replace('/', '')%5D = response;%0A      %7D);%0A    %7D);%0A  %7D;%0A%0A%0A  fetchLatest();%0A
 %7D;%0A%0Amodu

load latest entries for frontpage items