How can I clean the client cache in Angular2?

1

How can I clean the client cache in Angular2 (final version, not RCx)?

Every time I deploy a change made to an app on the server, it is not reflected on the page unless I clean the browser cache. In Angularjs if I know some methods to "delete" the browser cache but in Angular2, I have tried different options like the ones I mention below but without success ...

@Component({
  moduleId: module.id,
  selector: 'app-copyright',
  templateUrl: 'copyright.component.html' + myGlobals.fileVersion,
  //styleUrls: ['copyright.component.css'],
  providers:[VentanaModalComponent, EntitiesService]
})

myGlobals.fileVersion has value '? tmplv =' + Date.now ();

but it does not work. Better said, if I load the copyright.component.html? Tmplv = xxxxx but to load another version of that html I have to manually refresh the page. (that is, always load the old version)

I have also tried the option to clean the cache from code with the RuntimeCompiler.clearCache (), but again without success ....

Thanks in advance to everyone.

    
asked by Jorge Trigueros 09.01.2017 в 09:59
source

0 answers