<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-angularjs/lessons/your-first-app/exercises/your-first-app-ng-click-ii?action=resume
<In what way does your code behave incorrectly? Include ALL error messages.>
On the
element, make sure to use ng-click to call the minusOne() function.
Everything is set, but I still get the same error.
MainController
$scope.minusOne = function(index) {
$scope.products[index].dislikes -= 1;
};
$scope.plusOne = function(index) {
$scope.products[index].likes += 1;
};
index.html
<p class="dislikes" ng-click="minusOne($index)">
-{{product.dislikes}}
</p>