0

I'm trying to extend Papa John's tutorial on how to build a SPA. I've successfully added EF and is now able to query data (I'm able to view the response in JSON in firebug).

What I'm not able to do is change the html views. Any change I do in the details.html file will not render when I refresh the page. But, if I change something in the client model (details.js) then that change is rendered when I refresh.

I've tried to clean/rebuild the solution.

I tried making a change in the web config, but with no success, as described here: visual studio not updating html / javascript to server / browser

How come I can't update the html files with new markup? Does the browser really cache the html that hard and is there a simple way around this?

details.html

<section>
    <h3 class="page-title" data-bind="text: title"></h3>
    <span>This text was added by me and won't render</span>
</section>

details.js

define(['services/logger'], function (logger) {

    var title = "Details";

    // service name is route to the Web API controller
    var serviceName = 'breeze/Timing';

    // manager is the service gateway and cache holder
    var manager = new breeze.EntityManager(serviceName);

    var vm = {
        activate: activate,
        title: title
    };

    return vm;

    function activate() {

        return true();
    }
});
Community
  • 1
  • 1
Niklas
  • 13,005
  • 23
  • 79
  • 119

2 Answers2

0

You should try clearing the build in the .metadata of the Project. Always works for me.

Aman
  • 85
  • 9
0

I used the answer from this question: Prevent RequireJS from Caching Required Scripts

By updating the main.js and adding the code below in the require config.

In debug:

require.config({
    urlArgs: "v=" + Math.Random()
});

In release:

require.config({
    urlArgs: "v=2"
});
Community
  • 1
  • 1
Niklas
  • 13,005
  • 23
  • 79
  • 119