浏览器刷新后,不会显示angularjs代码更改 [英] angularjs code changes do not show up after browser refresh

查看:173
本文介绍了浏览器刷新后,不会显示angularjs代码更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何时候,我都会在.hmtl文件或.js文件中对代码进行更改,浏览器仍会呈现旧代码,并且我的新代码更改不会显示在浏览器结果中。



例如,我在.html文件中添加了以下两行代码:

 < div class =control-group> 
< label class =control-label>名字< / label>
< div class =controls readonly>
{{profile.FirstName}}
< / div>
< / div>

< div class =control-group>
< label class =control-label>姓氏< / label>
< div class =controls readonly>
{{profile.LastName}}
< / div>
< / div>

然后我执行以下操作:


  1. 在VS2013中,右键单击我的项目并在浏览器中查看(IE或Chrome)。
  2. 登录我的应用程序。

  3. 转到相应的页面,我看到旧的html文件的渲染。我没有看到新添加的2个div元素。

  4. 我甚至点击f5刷新浏览器,但仍然没有运气。

我做错了什么?

解决方案

开发工具。禁用缓存。重新加载您的网页。


Any time, I make code changes in .hmtl file or the .js file, the browser still renders the old code and my new code changes don't show up in the browser result.

For example, I add the following 2 lines of code in .html file.

    <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>

Then I do the following:

  1. In VS2013, right click on my project and view in browser (IE or Chrome).
  2. Login to my application.
  3. Go the respective page and I see the rendering of the old html file. I do not see the newly added 2 div elements rendered at all.
  4. I even hit f5 to refresh the browser but still no luck.

What am I doing wrong?

解决方案

Hit F12 in your browser to bring up the Developer Tools. Disable the Cache. Reload your page.

这篇关于浏览器刷新后,不会显示angularjs代码更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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