Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angularjs Currency filter, change currency dynamically?

I get the currency from the backend in a json object. When I try to show it using the currency filter what comes on screen is the currency code and not the actual currency.

I have used both the html binding method as well as the javascript method.

<span>{{smsData.smsAmount|currency:smsData.currencyCode}}<span>

The out put that i get is

&euro;1.00

when the expected out put is

€1.00

The same is true with using java script.

$scope.smsData.smsAmount = $filter('currency')($scope.smsData.smsAmount, $scope.smsData.currencyCode);

Please tell me how can i set the currency using parameters.

like image 371
chandings Avatar asked Apr 25 '26 00:04

chandings


1 Answers

An another solution:

<span ng-bind-html="smsData.smsAmount | currency:smsData.currencyCode"></span>
like image 168
runTarm Avatar answered Apr 26 '26 14:04

runTarm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!