无法在过滤器中插入HTML代码? [英] unable to insert html code inside filter?
问题描述
$ scope.rupee = $ filter('currency') ($ scope.dols * 67.33,'INR',3);
我试图在此过滤器中插入html代码。这不是'INR',我希望获得符号。请帮我解决这个问题。问题是没有获得通过过滤器。而不是'INR',我想使用&#8377,但它没有按照我的预期呈现。
< div> {{rupee}}< / div>
b
$ scope.rupee = $ filter('currency')($ scope.dols * 67.33,'\\\₹',3);
当您问到我们可以编写HTML代码里面的symbolFormat参数?
答案如下:
它接受一个字符串参数,因此无论您提供什么字符串,它都将用作货币符号
Angualr JS code:
$scope.rupee = $filter('currency')($scope.dols * 67.33, 'INR', 3);
I am trying to insert html code inside this filter. That is instead of 'INR', I wish to get ₹ symbol. Please help me to solve this. And the problem is not getting the ₹ through filter. Instead of 'INR', I want to use ₹ but it's not rendering as I expected.
html code:
<div>{{rupee}}</div>
Modify your statement to
$scope.rupee = $filter('currency')($scope.dols * 67.33, '\u20B9', 3);
As you asked, "Can we write HTML code inside symbolFormat parameter?" Answer will be below:
It takes a string parameter, so whatever string you are providing, it will be used to apply as currency symbol
For reference you can check Here
这篇关于无法在过滤器中插入HTML代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!