1

私はこのコードを持っていました:

<icon imgSrc="/dist/resources/images/price-tag.png" class="icon pull-xs-left"></icon>
<div id="price-value" class="value">
   {{result?.averagePrice | currency:'USD':true:'1.2-2'}}
</div>

しかし、私はそれをコンポーネントにしたので、今それを使用するには次のようになります:

<icon-with-value imgSrc="/dist/resources/images/price-tag.png" [value]='result?.averagePrice' class="icon pull-xs-left"></icon-with-value>

result?.averagePriceしかし、通貨として表示する必要があります。ご覧のとおり、コンポーネントにする前にそれを行っていました。これを変換するにはどうすればよいですか:[value]='result?.averagePrice'次のような通貨パイプで渡すには:[value]='result?.averagePrice | currency:'USD':true:'1.2-2''

4

0 に答える 0