1.控制器并列书写:
- directives.directive('onFinishRenderFilters', function ($timeout) {
- return {
- restrict: 'A',
- link: function(scope, element, attr) {
- if (scope.$last === true) {
- $timeout(function() {
- scope.$emit('ngRepeatFinished');
- });
- }
- }
- };
- });
2.在将要处理的HTML的demo上加上:on-finish-render-filters
- <uib-tabset active="activeJustified" class="mt10" on-finish-render-filters>
- <uib-tab ng-repeat="item in pigmanage.generallist" heading="{{item.name}}">
- <div class="tipcirclebox col-cm-6" ng-repeat = "its in item.tiplist" on-finish-render-filters>
- <div id="{{its.id}}" style="width: 500px;height:300px;" ></div>
- </div>
- </uib-tab>
- </uib-tabset>
3.在angular请求成功后添加执行函数:
- $scope.$on('ngRepeatFinished', function (ngRepeatFinishedEvent) {
- //下面是在table render完成后执行的js
- //debugger;
- $(function(){
- })
- });