dot*_*ner 34 html5 angularjs visual-studio-2013
任何时候,我在.hmtl文件或.js文件中进行代码更改,浏览器仍会呈现旧代码,并且我的新代码更改不会显示在浏览器结果中.
例如,我在.html文件中添加以下两行代码.
<div class="control-group">
<label class="control-label">First Name</label>
<div class="controls readonly">
{{profile.FirstName}}
</div>
</div>
<div class="control-group">
<label class="control-label">Last Name</label>
<div class="controls readonly">
{{profile.LastName}}
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
然后我做以下事情:
我究竟做错了什么?
Phi*_*rdt 50
在浏览器中点击F12以显示开发人员工具.禁用缓存.重新加载您的页面.
Nat*_*ini 21
除了使用Dev Tools确保禁用缓存之外,您还可以编辑Web.config
文件并告诉IIS不要缓存Angular文件:
<configuration>
<!-- Disable IIS caching for directories containing Angular templates and scripts -->
<location path="app">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="DisableCache"/>
</staticContent>
</system.webServer>
</location>
...
</configuration>
Run Code Online (Sandbox Code Playgroud)
我的Angular根目录是app/
.您可能需要根据文件结构进行修改.
归档时间: |
|
查看次数: |
48291 次 |
最近记录: |