Css 将鼠标悬停在数据行上时显示编辑/删除链接

Css 将鼠标悬停在数据行上时显示编辑/删除链接,css,angularjs,ng-class,Css,Angularjs,Ng Class,我在上有一个带有ng repeat的表,在上一个td中我有编辑/删除链接,我只想让它们显示用户是否将鼠标悬停在 CSS: ng控制器中存在语法错误。对于类名之后的表达式,它应该是一个:,并且您还希望为所选索引设置另一个ng类参数,该参数不等于$index: <tr ng-repeat="form in allData | filter:search | orderBy: orderByValue : orderIn" ng-click="set_index($index)">

我在
上有一个带有ng repeat的表,在上一个td中我有编辑/删除链接,我只想让它们显示用户是否将鼠标悬停在

CSS:


ng控制器中存在语法错误。对于类名之后的表达式,它应该是一个
,并且您还希望为所选索引设置另一个ng类参数,该参数不等于$index:

<tr ng-repeat="form in allData | filter:search | orderBy: orderByValue : orderIn" ng-click="set_index($index)">
          <td><a ng-href={{form.link}}>{{form.ar_ref}}</a></td>
          <td>{{form.title}}</td>
          <td>{{form.category}}
            <span ng-class="{'show_edit_link': $index==selected_index, 'edit_link': $index!=selected_index}">
              <button ng-click="showUpdate()">Update</button>
              <button ng-click="showDelete()">Delete</button>
            </span>
          </td>
        </tr>

{{form.title}
{{form.category}}
更新
删除

Good call,这个语法的一个很好的提醒是ng类等于一个对象,应该像其他对象一样遵循与key:value对相同的结构。reguar css有什么问题?噢~不错,聪明。
pp.controller('formsListCtrl', ['$scope', '$http', function($scope, $http){

  $http.get('/php_user/formJSON.php').success(function(response){
    $scope.allData=response; 

    //Show hover edit links
    $scope.selected_index = 0;
    $scope.set_index = function(i){ //i is the $index that we will pass in when hover in the forms_admin.php
      $scope.selected_index = i;
    }
.edit_link_show{
  display: inline;
}
.edit_link{
  display: none;
}
<tr ng-repeat="form in allData | filter:search | orderBy: orderByValue : orderIn" ng-click="set_index($index)">
          <td><a ng-href={{form.link}}>{{form.ar_ref}}</a></td>
          <td>{{form.title}}</td>
          <td>{{form.category}}
            <span ng-class="{'show_edit_link': $index==selected_index, 'edit_link': $index!=selected_index}">
              <button ng-click="showUpdate()">Update</button>
              <button ng-click="showDelete()">Delete</button>
            </span>
          </td>
        </tr>