Возникают проблемы с получением области действия ng-repeat, даже если я получаю, что она не работает - PullRequest
0 голосов
/ 17 февраля 2019

Вот код

 <tr ng-repeat="x in arry" ng-init="initscope($parent)" ng-mouseover="hoverIn()" ng-mouseleave="hoverOut()">
          <td>{{x.name}}</td>
          <td>{{x.review}}</td>
          <td>{{x.rating}}</td>
          <td>
            <button ng-click="edit($index)"  ng-init="shw=false" ng-show="shw" class="btn waves-effect waves-white btn-small" style="background-color:#b23c3c;">Edit
              <i class="material-icons right">edit</i>
            </button></td>
          <td>
              <button ng-click="delete($index)" ng-init="shw=false" ng-show="shw" class="btn waves-effect waves-white btn-small" style="background-color:#b23c3c;">Delete
                  <i class="material-icons right">cancel</i>
                </button>
          </td>
        </tr>

Что я делаю, я хочу, чтобы эти две кнопки показывались, когда я наводил курсор на строку.Вот код JS

   $scope.initscope=function($prntscope)
 {
     $scope.ngrptscope=$prntscope;
 }
 $scope.hoverIn=function(){
        $scope.ngrptscope.shw=true;
        console.log("in hover in"+$scope.shw);
 }

 $scope.hoverOut=function(){
$scope.ngrptscope.shw=false;
        console.log("in hover out"+$scope.shw);   
  }
...