I am developing shop which suppots many different currency. On backend all money are in USD, curreny will be converted at client side while displaying page basing on user IP.
Im wondering if I should use:
- Service which will use
$http
call to gather current currency rate from for example google page and after all items are displayed, loaded then start converting all prices to already set user default currency, it shouldn't take long. - Custom angularJS
filter
but it can't call currency request every time the info about currency must be gathered before filter start working. So anyway I have to create and execute some function, (service
orfactory
) and constrain to execute this service before filter start his job. But basing on this answer service execute before filter.
Which of this approach is better? Or maybe there is some better way of converting currency on client side that I don't know?