ng-repeat finish event

前端 未结 15 2635
盖世英雄少女心
盖世英雄少女心 2020-11-22 02:15

I want to call some jQuery function targeting div with table. That table is populated with ng-repeat.

When I call it on

$(document).r         


        
15条回答
  •  不思量自难忘°
    2020-11-22 03:00

    I found an answer here well practiced, but it was still necessary to add a delay

    Create the following directive:

    angular.module('MyApp').directive('emitLastRepeaterElement', function() {
    return function(scope) {
        if (scope.$last){
            scope.$emit('LastRepeaterElement');
        }
    }; });
    

    Add it to your repeater as an attribute, like this:

    According to Radu,:

    $scope.eventoSelecionado.internamento_evolucoes.forEach(ie => {mycode});
    

    For me it works, but I still need to add a setTimeout

    $scope.eventoSelecionado.internamento_evolucoes.forEach(ie => {
    setTimeout(function() { 
        mycode
    }, 100); });
    

提交回复
热议问题