From 284fbe71ab64dc886e2ee60662fc45ac291dd858 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Tue, 30 May 2017 11:51:51 -0400 Subject: [PATCH] webstaff: join filter for angular templates Signed-off-by: Jason Etheridge --- Open-ILS/web/js/ui/default/staff/services/ui.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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. * -- 2.11.0