6, ng repeat I


#1

https://www.codecademy.com/en/courses/learn-angularjs/lessons/your-first-app/exercises/your-first-app-ng-repeat-i?action=resume

Help me with that code. I am pretty sure my coding is right. I have changed identation also but it didn't work


#2

which part of the code ? 1, 2, 3?


#3

I have problem in 2nd part


#4

your code should look like this

$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'
}
] ;

the final semicolon is optional


#5

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 to be Programmed',
price: 8,
pubdate: new Date ('2013', '08', '01'),
cover: 'img/program-or-be-programmed.jpg'
}
];
}]);

still I got the error message with this code:

In $scope.products, did you add the "Program or be Programmed" object?


#6

what error do you get?


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.