AngularJS - 在 $(document).ready 上的 ng-repeat 循环中定位元素 [英] AngularJS - targeting elements inside an ng-repeat loop on $(document).ready

查看:21
本文介绍了AngularJS - 在 $(document).ready 上的 ng-repeat 循环中定位元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为 AngularJS 的新手,我正在寻找一种在 $(document).ready 被触发后在 ng-repeat 循环中定位元素的方法.然而,他们当时似乎还没有准备好.感谢您的帮助.

Being new to AngularJS, I'm looking for a way to target elements inside an ng-repeat loop after $(document).ready is fired. They don't seem to be ready at the time however. Thanks for any help.

推荐答案

这个 博文 讨论了在控制器中监听 $viewContentLoaded 事件以调用函数而不是使用 $(document).ready::>

This blog post discusses listening to the $viewContentLoaded event in your controller to call your function instead of using $(document).ready:

function stuffController($scope) {
    $scope.$on('$viewContentLoaded', readyFunction);
}

这篇关于AngularJS - 在 $(document).ready 上的 ng-repeat 循环中定位元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆