Bug #243 Creacion del filtro dash-if-empty para ticket Index

This commit is contained in:
Gerard 2018-04-19 15:00:44 +02:00
parent 155e5a4d4f
commit c651428063
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import ngModule from '../module';
/**
* Returns dash when value is empty, otherwise returns the same string.
*
* @return {String} The string result
*/
export default function dashIfEmpty() {
return function(input) {
if (input == null || input == '')
return '-';
return input;
};
}
ngModule.filter('dashIfEmpty', dashIfEmpty);

View File

@ -1,2 +1,3 @@
import './phone';
import './ucwords';
import './dash-if-empty';