Q:

Difference between Formatter and Factory Function

​Hello,
Please explain what is the difference between Factory and Formatter function. Because as I see both can be used to format or manipulate the output results.  How to choose between both of them ?
Regards,
Mayank

A:

Factory functions allows you to create different types of controls in runtime. Let's assume that you have a list and you want to display different type of list items according to your list index for instance, or maybe to some value that you have in your model. Factory functions allows you to do it in the binding way. 
Formatters are some kind of an helper functions which receive and input and return an output. The most popular examples are date and time that you receive date in form A and return date in form B. formatter functions are defined on a property level so if you have a field in your list item which display a date you can use formatter in order to do a very simple manipulation to this date

