function onLiteratureData (data, reset) {
                    // $log.log('onLiteratureData');
                    reset = reset || false;
                    if (reset) {
                        scope.hits = [];
                        scope.noftotal = 0;
                    }
                    // literature
                    scope.hits.push(data.hits); // store every batch as a 'page' of results
                    // calculate the number of papers shown
                    scope.noftotal = scope.hits.reduce(function (a, b) { return a + b.hits.length; }, 0);
                    // a flattened list of just the hits (publications) to avoid nested looping in the HTML if we want to
                    // scope.papers = scope.hits.reduce( function(a,b){ return a.concat(b.hits)} , [] );
                }
/*
                 * Handler for literature data
                 * data : the API response data
                 * reset : if true, previous literature data is removed; if false (DEFAULT), new literature data is appended (e.g. pagination)
                 */
Handler for literature data
data : the API response data
reset : if true, previous literature data is removed; if false (DEFAULT), new literature data is appended
Handler for literature data data : the API response data reset : if true previous literature data is removed ; if false ( DEFAULT ) new literature data is appended
function onLiteratureData (data, reset) {
                    reset = reset || false;
                    if (reset) {
                        scope.hits = [];
                        scope.noftotal = 0;
                    }
                    scope.hits.push(data.hits); 
                    scope.noftotal = scope.hits.reduce(function (a, b) { return a + b.hits.length; }, 0);
                }
function onLiteratureData ( data , reset ) { reset = reset || false ; if ( reset ) { scope . hits = [ ] ; scope . noftotal = 0 ; } scope . hits . push ( data . hits ) ; scope . noftotal = scope . hits . reduce ( function ( a , b ) { return a + b . hits . length ; } , 0 ) ; }
Handler for literature data
 data : the API response data
 reset : if true, previous literature data is removed; if false (DEFAULT), new literature data is appended (e.g.
Handler for literature data data : the API response data reset : if true previous literature data is removed ; if false ( DEFAULT ) new literature data is appended ( e . g .
// $log.log('onLiteratureData'); // literature // store every batch as a 'page' of results // calculate the number of papers shown // a flattened list of just the hits (publications) to avoid nested looping in the HTML if we want to // scope.papers = scope.hits.reduce( function(a,b){ return a.concat(b.hits)} , [] );