Your First APP 10/11


#1



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


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>

#2

Here,

It should be +=1.

So that it counts upward. Your minus ( - ) sign in view will help display it as a dislike to your user.


#3

Thank you!
i tried everything, but did not tink of that!!
<3


#4

You're welcome, @jfsene .

Have fun coding! :slight_smile:


#5

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