Closed ranode closed 6 years ago
Yes you can.
For example :
expressions.filters.currency = function (input, currency, digits) {
input = input.toFixed(digits);
if (currency === "EUR") {
return input + "€";
}
return input + "$";
};
evaluate = compile("1.2345 | currency:'EUR'");
expect(evaluate({
selectedCurrency: "EUR"
})).to.equal("1.23€");
Is there a way to use a string as filter param? Eg. a date format string. This could just be a static string value, without needing to evaluate against scope.