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

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

问题描述

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

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

 

<label class="control-label">名字</label><div class="控件只读">{{profile.FirstName}}

<div class="control-group"><label class="control-label">Last Name</label><div class="控件只读">{{profile.LastName}}

然后我执行以下操作:

  1. 在 VS2013 中,右键单击我的项目并在浏览器(IE 或 Chrome)中查看.
  2. 登录我的应用程序.
  3. 转到相应的页面,我看到旧 html 文件的呈现.我根本没有看到新添加的 2 个 div 元素呈现出来.
  4. 我什至按 f5 键刷新浏览器,但仍然没有运气.

我做错了什么?

解决方案

在浏览器中按 F12 以打开开发人员工具.禁用缓存.重新加载您的页面.

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天全站免登陆