AngularJS 在开发机器上禁用部分缓存 [英] AngularJS disable partial caching on dev machine

查看:23
本文介绍了AngularJS 在开发机器上禁用部分缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 AngularJS 中缓存部分有问题.

I have problem with caching partials in AngularJS.

在我的 HTML 页面中,我有:

In my HTML page I have:

<body>
 <div ng-view></div>
<body>

我的部分加载在哪里.

当我更改部分 HTML 代码时,浏览器仍会加载旧数据.

When I change HTML code in my partial, browser still load old data.

有什么解决办法吗?

推荐答案

对于开发,您还可以停用浏览器缓存 - 在 Chrome Dev Tools 的右下角点击齿轮并勾选选项

For Development you can also deactivate the browser cache - In Chrome Dev Tools on the bottom right click on the gear and tick the option

禁用缓存(DevTools 打开时)

Disable cache (while DevTools is open)

更新:在 Firefox 中,调试器 -> 设置 -> 高级部分(已检查版本 33)中有相同的选项

Update: In Firefox there is the same option in Debugger -> Settings -> Advanced Section (checked for Version 33)

更新 2:虽然此选项出现在 Firefox 中,但有人报告说它不起作用.我建议使用 firebug 并遵循 hadaytullah 的回答.

Update 2: Although this option appears in Firefox some report it doesn't work. I suggest using firebug and following hadaytullah answer.

这篇关于AngularJS 在开发机器上禁用部分缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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