I have a book model that i use a mapBy()
computed property on to retrieve all the prices in the model. allPrices: mapBy('books', 'price');
Then i use max()
to get the highest value. maxPrice: max('allPrices');
That part works as expected. The problem i have is that i want to display the max price AND the title of the book associated with that price but i cant figure out how to do it.
<h2>Max book price: </h2>
<h2>Which belongs to the book </h2>
How can this be achieved? Any help would be appreciated.
Aucun commentaire:
Enregistrer un commentaire