Usage : {{ [{ value: 5 }, { value: 4 }] | sum:'value' }}
Result : {{ [{ value: 5 }, { value: 4 }] | sum:'value' }}
Usage : {{ 3675| prettySecs }}
Result : {{ 3675 | prettySecs }}
Replace the content of the input in the same fashion as String.Prototype.replace
Usage : {{ 'Hello everybody' | replace : RegExp('every') : 'no' }}
Result : {{ 'Hello everybody' | replace : RegExp('every') : 'no' }}
Make sure that RegExp
is attached to your scope if you want the inline notation
Replace the input according to a defined mapping
Usage : {{ something.ugly_integer_status | map : 'orderStatus' }}
Mapping definition :
angular.module('super-module', ['ev-fdm']) .config(function(mapFilterProvider) { mapFilterProvider.registerMapping('orderStatus', { 0: 'Commande validée', 1: 'Commande expédiée', 2: 'Commande reçue' }); // Optional, a default value can be defined mapFilterProvider.registerDefault('orderStatus', 'État inconnu'); }) ;