AngularJS 监听某数据集渲染完成

/*
* Controller文件中的代码 
* Setup general page controller 
*/
MetronicApp.controller('simpleManageController', ['$rootScope', 
'$scope', 'settings','$http', function($rootScope, $scope, settings,$http) {

    $scope.$on('ngRepeatFinished', function (ngRepeatFinishedEvent) {
        //下面是在table render完成后执行的js
        FormEditable.init();
        Metronic.stopPageLoading();

        $(".simpleTab").show();

    });
});
    
    
MetronicApp.directive('onFinishRenderFilters', function ($timeout) {
    return {
        restrict: 'A',
        link: function(scope,element,attr) {
            if (scope.$last === true) {
                $timeout(function() {
                    scope.$emit('ngRepeatFinished');
                });

            }
        }
    };
});
  <!--HTML页面的代码,添加标签onFinishRenderFilters(格式有变):on-finish-render-filters-->
  <tr style="display: none" class="simpleTab" ng-repeat="simpleProduct in simpleProducts"
      on-finish-render-filters>
          <td>
              {{simpleProduct.productNo}}
          </td>
 </tr>


你可能感兴趣的:(AngularJS 监听某数据集渲染完成)