From: Jason Etheridge Date: Tue, 30 May 2017 15:51:51 +0000 (-0400) Subject: LP#1708291: add a join filter for angular templates X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7b9b9601b7544ea46b45e08c6c6297fb5c9d7168;p=working%2FEvergreen.git LP#1708291: add a join filter for angular templates Signed-off-by: Jason Etheridge Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js index 5080b542f3..f632478f1f 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -223,6 +223,18 @@ function($timeout , $parse) { return eg_context_due_date_filter; }]) +// 'join' filter +// TODO: perhaps this should live elsewhere +.filter('join', function() { + return function(arr,sep) { + if (typeof arr == 'object' && arr.constructor == Array) { + return arr.join(sep || ','); + } else { + return ''; + } + }; +}) + /** * Progress Dialog. *