'use strict';

// @ngInject
var authorsDirective = function() {
  return {
    scope: {
      authors: '='
    },
    template: require('./authorstemplate.html'),
    //@ngInject
    controller: function($scope) {
      $scope.fullnames = function (authors) {
        return authors.reduce((m, a, i) => m + a.first_name + ' ' + a.last_name + (i < authors.length-1 ? ', ':''), '');
      };
    }
  };
};


module.exports = authorsDirective;

@@ -300,11 +300,58 @@
  =%3E 
-m +
+%7B%0A          return m +%0A            (a.first_name ?
  a.f
@@ -380,17 +380,39 @@
 st_name 
-+
+: a.name) +%0A           
  (i %3C au
@@ -436,16 +436,27 @@
 ', ':'')
+;%0A        %7D
 , '');%0A 

Support first_name, last_name and name