I am trying to change a class that I am creating based on a value that I get from json, and then change it if user cliks on it, but I am not getting that to work.

This is my code in the controller:

```
$scope.like = function(){
      if ($scope.class === "ion-ios-heart-outline")
        $scope.class = "ion-heart";
      else
        $scope.class = "ion-ios-heart-outline";
    };

```

And the element in the view:

```
<i ng-click="like()" ng-class="{ 'ion-heart' : article.like == 1, 'ion-ios-heart-outline' : article.like == 0}">

```