From 7b9b9601b7544ea46b45e08c6c6297fb5c9d7168 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Tue, 30 May 2017 11:51:51 -0400 Subject: [PATCH] LP#1708291: add a join filter for angular templates Signed-off-by: Jason Etheridge Signed-off-by: Galen Charlton --- 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 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. * -- 2.11.0