zoukankan      html  css  js  c++  java
  • AngularJS监听DOM加载完毕

    直接上代码:

    Module.directive('renderFinish', function ($timeout) {      //renderFinish自定义指令
        return {
            restrict: 'A',
            link: function(scope, element, attr) {
                if (scope.$last === true) {
                    $timeout(function() {
                        scope.$emit('ngRepeatFinished');
                    });
                }
            }
        };
    });
    /* 控制器 */
    nassModule.controller('mallHome', ['$scope', '$http', function($scope, $http) {
    
        $scope.$on('ngRepeatFinished', function(){
            $scope.funName();
        });
    
    }]);
    <li ng-repeat="item in data.focus" render-finish>content</li>
  • 相关阅读:
    5-29
    5-28
    5-27
    -5-26
    5-25
    5-24
    5-21
    RabbitMQ消息中间件极速入门与实战
    细说java多线程之内存可见性
    全面解析java注解
  • 原文地址:https://www.cnblogs.com/jach/p/5734964.html
Copyright © 2011-2022 走看看