For some reason codeacademy keeps saying
In $scope.products did you add your ‘Program or be Programmed object?’
But I did and I don’t get any notifications of bad syntax before hitting ‘Run’ button
app.controller('MainController',['$scope',function($scope){
$scope.title = 'MathChamp';
$scope.promo = "my own string";
$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: 9,
pubdate: new Date('2013','08','01'),
cover:'img/program-or-be-programmed.jpg'
}
];
}]);
@gustaxpa,
Try it with a different indentation
app.controller('MainController',['$scope',function($scope){
$scope.title = 'MathChamp';
$scope.promo = "my own string";
$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: 9,
pubdate: new Date('2013','08','01'),
cover:'img/program-or-be-programmed.jpg'
}];
}]);
1 Like
My Code works:
it could be, that it only takes the pre set title ‘This Month’s Bestsellers’, cuz the devs of this were noobs :() u should try that
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'
}
];
}]);