谷歌浏览器中的Angular Bootstrap Modal Slow ng-repeat [英] Angular Bootstrap Modal Slow ng-repeat in Google Chrome

查看:183
本文介绍了谷歌浏览器中的Angular Bootstrap Modal Slow ng-repeat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在中使用了$ modal,并且已经运行成绩问题仅限于Google Chrome浏览器。我在模态实例中有一个ng-repeat指令,并将它绑定到300行,并且它与我的处理器挂钩并锁定浏览器几秒钟。这只发生在Google Chrome中。我在Firefox中试过,并且相同的代码工作正常。 下面是一个说明问题的解决方案 - 如果您在Chrome中打开此项功能,我怀疑您的我也会看到这个问题。



我在这里做错了什么?为什么在Chrome中执行此操作而不是Firefox时,这对CPU造成严重影响?在Chrome中使用相同的HTML和JavaScript,而无需Bootstrap模式正常工作,所以它必须是否与Bootstrap有关?

解决方案

像其他评论一样,我在我的笔记本电脑上使用Chrome(win 64,Chrome 31)

但是,您在模式范围内有900多名观察者(请参阅: http://plnkr.co/edit/LIOAzVI4hACROqXlhICq?p=preview



你也许应该看看 bindonce模块可以在低CPU设备上加快速度。


I'm using the $modal in Angular Bootstrap UI and have run into a performance issue in Google Chrome only. I have an ng-repeat directive inside of my modal instance, and am binding it to 300 rows, and it's pegging my processor and locking up the browser for seconds. This only happens in Google Chrome. I tried it in Firefox and the same code works fine. Here's a plunker that illustrates the problem - if you open this in Chrome I suspect that you'll see the issue as well.

Am I doing something wrong here? Why is this so taxing on the CPU when executed in Chrome as opposed to Firefox? Using the same HTML and JavaScript WITHOUT the Bootstrap modal works just fine in Chrome, so it must be something related to Bootstrap?

解决方案

Like other comment I have no problem on my laptop in Chrome (win 64, Chrome 31)

But you have 900+ watchers on the modal scope (see : http://plnkr.co/edit/LIOAzVI4hACROqXlhICq?p=preview)

You should maybe take a look at bindonce module to speed things up on low CPU devices

这篇关于谷歌浏览器中的Angular Bootstrap Modal Slow ng-repeat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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