Skip to Content
Jun 08, 2016 at 05:17 AM

Dependency issue with custom formatter



I was referring below link to use custom formatter in my application:

This works fine but I need to take a different approach as per my Application framework. So I did the following things as below:

1. Create a formatter file under a specific folder

(function() {

'use strict';"mytravelandexpense.formatter.myGenericFormatter");

mytravelandexpense.formatter.myGenericFormatter = {};

mytravelandexpense.formatter.myGenericFormatter.concatenateObjDesc = function(o, d) {

return 0 + ' -' + d;



2. I have created a dependency in my controller as below:"mytravelandexpense.formatter.myGenericFormatter");

3. Next I have used this formatetter in my view :

text="{ parts:[{path: 'Model1>CostObjectID'}, {path:'Model2>Description'}], formatter:'mytravelandexpense.formatter.myGenericFormatter.concatenateObjDesc'}"

But in console I see, it says the formatter is not found.

Could you please help me to understand where I am doing the wrong.

- Thanks , Somnath