Q:

AngularJS expression if value is in array

I am trying to add a class to an element if a value is in an array within the scope, but it doesn't seem to be working. 
Here is my code:
$scope.weather = [];
$scope.cool = ['Cool'];
$scope.mild = ['Mild'];
$scope.hot = ['Hot'];

$scope.selectWeather = function(weatherType){
    if($.inArray(weatherType, $scope.weather) == -1){
        $scope.weather.push(weatherType);
    }else{
        $scope.weather.splice($.inArray(weatherType, $scope.weather),1);
    }       
}

<a class="cool" ng-click="selectWeather('Cool');" ng-class="{'selected': cool.$indexOf(weather) ! = -1}">
    Cool
</a>

Thanks for your help. 

A:

The problem is that you are using $indexOf() inside your ng-class, which is not a function.  Just use the regular indexOf in your template like this:
<a class="cool" 
   ng-click="selectWeather('Cool')"
   ng-class="{'selected': weather.indexOf('Cool') ! = -1}">Cool</a>

Your selectWeather function was also not quite correct:
$scope.selectWeather = function (weatherType) {
  if ($scope.weather.indexOf(weatherType) == -1) {
    $scope.weather.push(weatherType);
  } else {
    $scope.weather.splice($scope.weather.indexOf(weatherType), 1);
  }       
}

There are also some other issues with your code which I fixed in this JSFiddle.