Pass piped value to child component

186 Views Asked by At

I used to have this code:

<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>

But i made it into a component so now to use it it is like:

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

But i need to get the result?.averagePrice to display as currency. It was doing that before I made it a component as you can see. How do I convert this: [value]='result?.averagePrice' to pass it in with a currency pipe like this: [value]='result?.averagePrice | currency:'USD':true:'1.2-2''

0

There are 0 best solutions below