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=4f88256c7588e1ecea1995d4e3c4d98833f1e994;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 5acf817dd9..15ac78807a 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. *