From: Jason Etheridge Date: Tue, 30 May 2017 15:51:51 +0000 (-0400) Subject: webstaff: join filter for angular templates X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=284fbe71ab64dc886e2ee60662fc45ac291dd858;p=working%2FEvergreen.git webstaff: join filter for angular templates Signed-off-by: Jason Etheridge --- 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 5b3674227a..f08ac326c5 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -84,6 +84,18 @@ function($timeout , $parse) { }; }) +// '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. *