3/11


#1
app.controller('MainController', ['$scope', function($scope) {
$scope.title = 'Blacksmitj';
$scope.promo = 'New Entry';
$scope.product = {
   name: "The Book of Trees',
   price: 19
}
}]);

is that correct ?


#2

I believe so. I got the same code.


#3

Why don't you have to create an object variable as you would in literal notation on this exercise?


#4

What do you mean? Might help to explain it with a code example.


#5

app.controller('MainController', ['$scope', function($scope) {
$scope.title = 'My Favorite Books';
$scope.promo = 'Best reads of 2015';
$scope.product = { name: 'The Book of Trees',
price: 19
}
}]);

What is wrong with this code? It doesn't error out but it won't run either. I can't continue on in the course because of it.


#6

You have forgotten to add a semi-colon at the end of penultimate line (after the single end brace). My code is working OK.


#7

You´re missing a semicolon, your code should look like this:

app.controller('MainController', ['$scope', function($scope) {
$scope.title = 'My Favorite Books';
$scope.promo = 'Best reads of 2015';
$scope.product = { name: 'The Book of Trees',
price: 19
};
}]);


#8

should it be like this?

 <p class="title">product.name</p>
            <p class="price">product.price</p>

#9

like this...

app.controller('MainController', ['$scope', function($scope) {
$scope.title = 'This Month\'s Bestsellers';
$scope.promo = 'The most popular books this month.';
$scope.product=
{
name:"The Book of Trees",
price:19
};
}]);


#10

look at the

{{ title }}

make

the same so:
{{ product.name }} should be inside the class