NG-Click I


#1

I do not understand why my code doesn't work, the instructor says to,
In the view under <p class="date">, type in a rating element:

<div class="rating"> 
  <p class="likes">+ </p> 
</div>

Inside <p class="likes">, display a product's likes using an expression.

My Code:

                   <div class="rating">
			<p class="likes">{{ products.likes }}</p> 
                   </div>

Could someone please explain how to do this?
Thanks in advance!


#2

If you put the other data in to you main controller its has to work like a charm:

You MainController:
{
name: 'Moby Dick',
price: 32,
pubdate: new Date('2003','07','01'),
cover: 'http://www.mobydickcontent.com/wp-content/uploads/2015/03/2468350_14789092_lz.jpg',
likes: 0
},

In your Index:

               <div class="rating">
		<p class="likes">{{ products.likes }}</p> 
               </div>

You code wil work!