angularjs - 捕获页面是否完全加载在 angularjs 中不起作用(具有多个 ng-repeat 和一个具有大量数据的)
问题描述
我在我的 angularjs 项目中有一个问题我用它来捕捉文档是否准备好
app.directive('resolveApplication', function ($timeout) {
return {
restrict: 'A',
link: function (scope) {
scope.$$postDigest(function () {
angular.element(document).ready(function () {
$timeout(function () {
scope.ngRepeatFinished = true;
}, 0)
});
});
}
}
});
$http.get("api/customers", {}, { params: { partner: partner } }).then(function (response) {
$scope.customer = response.data.Liste
})
所以我看到文件已加载。但是当我想在我的页面中做一些事情时,我做不到。当我在我的代码中对此进行评论时,它可以完美运行。
PS:$scope.customer 有很多数据,我想问题来自于此,但使用指令我不应该有这个问题。
<div class="form-group">
<label style="width : 100px">Customer</label>
<select class="form-control SL_Customer">
<option value="">---Please select---</option>
<option ng-repeat="option in customer" value="{{option.CustomerUID}}">{{option.Customer}}</option>
</select>
</div>
更新
当页面未准备好时,我想显示一个进度圈。这个 resolveApplication 指令也应该在 angularjs 完成时捕获。但我的问题是当我使用指令时,我的进度圈在我的选择中插入数据(我猜)结束之前隐藏。
所以在进度圈被隐藏之后,我的选择中仍然插入了一些数据(因为我有很多数据),所以我不能在输入中写入文本,例如。
结果是我可以在我的页面中猜测的 5 秒内做任何事情。
解决方案
推荐阅读
- intellij-idea - 如何在 Intellij 中禁用 TestNG
- android - HttpLoggingInterceptor 不记录
- excel - 如何修复以下代码中未找到的对象
- javascript - 如何使用“exec”url 而不是“dev”url 从 Google Apps 脚本创建 webhook。执行返回 403 错误
- groovy - 根据最高的排序字符串
- python - 在迭代列表时使用 Python 更新最小值和最大值
- python - 如何在Flask webapp中拆分子进程的输出行
- ios - 如何在 TabBarController 中重用系统图标?
- javascript - 如何从 php 脚本中获取响应文本?
- html - 图像类型 webp。浏览器加载两种格式