Expressions


#1

https://www.codecademy.com/courses/learn-angularjs/lessons/your-first-app/exercises/your-first-app-ng-repeat-i?action=resume_content_item
I am working on this exercise.
From MainController.js
app.controller(‘MainController’, [’$scope’, function($scope) {
$scope.title = ‘This Month’s Bestsellers’;
$scope.promo = ‘The most popular books this month.’;
$scope.products = [
{name: ‘The Book of Trees’, price: 19, pubdate: new Date(‘2014’, ‘03’, ‘08’), cover: ‘img/the-book-of-trees.jpg’},
{name: ‘Program or be Programmed’, price: 8, pubdate: new Date(‘2013’, ‘08’, ‘01’), cover: ‘img/program-or-be-programmed.jpg’}
]
}]);

From index.html

{{product.name | uppercase}}

{{product.price | currency}}

{{product.pubdate | date}}

Why should we use product.name, product.price, product.pubdate instead of products.name, products.price, products.pubdate?
I used $scope.products in js file.