In Angular 2, how do you clear the template cache? There are tons of answers for Angular 1, but none for 2.
The issue I am having is that when I change the contents
I had a similar question. As a quick hack, i've solved this by introducing a global var in a module like export var fileVersion = '?tmplv=' + Date.now();
- at development time and change it for production - and use it in components like:
@Component({
selector: 'my-component',
templateUrl: '/app/templates/my-component.html' + fileVersion,
})
So I have just to refresh the browser to see the changes. In production use export var fileVersion = '?tmplv=v1.3.7yourVersionNumber';
.