0

Currently, I am facing a strange issue in my Angular 2 application.

I have two component for addition of records and update record i.e. menu-add and menu-edit.

And these components are injected in main module also.

Everything is working fine but I have changed some code in menu-add.ts and clean/build/rebuild vs project too, but I am not getting the changes reflection in website, even in console I am getting old code.

So is their any way to versioning components in module.ts or versioning whole angular app?

Ralf de Kleine
  • 11,464
  • 5
  • 45
  • 87
Dhiren
  • 153
  • 1
  • 13
  • 1
    Does this answer your question? [Clear browser cache in Angular](https://stackoverflow.com/questions/55517060/clear-browser-cache-in-angular) – wentjun Apr 22 '20 at 02:22

2 Answers2

2

If you are using the Chrome browser:

  • open developer tools (F12)
  • open tab Network
  • check 'Disable cache'
  • use CTRL+F5 to refresh

You can also check the compiled output Javascript files in the dist folder (or other output path).

Ralf de Kleine
  • 11,464
  • 5
  • 45
  • 87
1

This is a common problem with Angular. There are two methods for this:

  • Refresh by pressing Ctrl + F5 to clear the cache
  • It may not work if you use template files linked to templateUrl attribute. In this case, the only solution is to clear the cache of your browser.
  • 1
    actually I maintain cache clear with Ctrl + F5 but today it was not working as usual. – Dhiren Aug 22 '18 at 12:02
  • 1
    In a working application, how can we tell our users to clear caches. This certainly is not the right approach. – Smith Jun 21 '19 at 07:30