ng-repeat finish event

前端 未结 15 2664
盖世英雄少女心
盖世英雄少女心 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 did it this way.

    Create the directive

    function finRepeat() {
        return function(scope, element, attrs) {
            if (scope.$last){
                // Here is where already executes the jquery
                $(document).ready(function(){
                    $('.materialboxed').materialbox();
                    $('.tooltipped').tooltip({delay: 50});
                });
            }
        }
    }
    
    angular
        .module("app")
        .directive("finRepeat", finRepeat);
    

    After you add it on the label where this ng-repeat

    • {{ value }}

    And ready with that will be run at the end of the ng-repeat.

提交回复
热议问题