title: Angularjs data-ng-click wont work a second time...how?
body: <p>JSP page</p>
  
  <pre><code> &lt;form&gt;
     &lt;table class="countrys" data-name="tableCountry"&gt;
      &lt;tr bgcolor="lightgrey"&gt;
       &lt;th&gt;Country ID&lt;/th&gt;
       &lt;th&gt;Country Name&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr data-ng-repeat="c in allCountrys"
       data-ng-click="selectedCountry(c, $index);"
       data-ng-class="getSelectedClass(c);"&gt;
       &lt;td&gt;{{c.countryId}}&lt;/td&gt;
       &lt;td&gt;{{c.countryName}}&lt;/td&gt;
      &lt;/tr&gt;
     &lt;/table&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>controller</p>
  
  <pre><code>$scope.selectedCountry = function(country, index){
  angular.forEach($scope.allCountrys,function(value, key) {
        if (value.countryId == country.countryId) {
         $scope.selectedCountry = country;
        }
   });
  
  $scope.selectedRowCountry = index;
  }
  
  
  $scope.getSelectedClass = function(country) {
  
   if ($scope.selectedCountry.countryId != undefined) {
    if ($scope.selectedCountry.countryId == country.countryId) {
     return "selected";
    }
   }
   return "";
  };
  </code></pre>
  
  <p>css</p>
  
  <pre><code>tr.selected {
     background-color: #aaaaaa;
  }
  </code></pre>
  
  <p>there is this table on my page, once i press 1 row, it selects it, it changes the color, and it goes in both functions...</p>
  
  <p>but once i click on another row, it wont go to the selectedCountry function, but only into the sgetSelectedClass function</p>
  
  <p>i dont know why, i just wont to be able to select one row, then another one and so on...so that always just one row is selected </p>
  
  <p>can u help me?</p>