使用 angularjs 显示加载图标或加载进度条 [英] Display Loading Icon or Loading Progress Bar using angularjs

查看:29
本文介绍了使用 angularjs 显示加载图标或加载进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用angularjs显示加载图标或加载进度条.我的意思是在 jquery 中使用的类似 $("body").addClass("loading");, $("body").removeClass("loading");,我看到了一些进度条的链接,它类似于 youtube 加载条,但我不想要那样,我想要简单的进度条或加载 iage 或加载图标或加载条,显示条从模块移动到模块,标签到选项卡.有没有什么链接或者函数可以清楚地说明如何使用它.

How to display the loading Icon or loading Progress bar using angularjs. I mean something like this which used in jquery $("body").addClass("loading");, $("body").removeClass("loading");, I saw some links for progress bar which is of like youtube loading bar but i don't want like that I want simple progress bar or loading iage or loading icon or loading bar which show bar moving from module to module, tabs to tabs. Is there any link or function which explain clearly how to use it.

推荐答案

如果你不想自己实现,下面有几个链接.

if you dont want to implement it yourself, below are few links.

angular-spinnerangular-sham-spinner

另请阅读此BLOG 详细介绍了微调器如何与 angularjs 配合使用

also read this BLOG which details how the spinner works with angularjs

编辑根据评论

app.directive("spinner", function(){
return: {
restrict: 'E',
scope: {enable:"="},
template: <div class="spinner" ng-show="enable"><img src="content/spinner.gif"></div>
}
});

我还没有测试过代码,但指令不会比这更复杂...

i havent tested the code but directive wont be more complex than this...

这篇关于使用 angularjs 显示加载图标或加载进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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