Angular CLI and auto-refresh

angularangular-cli

I work with the Angular CLI and when I run "ng serve" the project is supposed to refresh automatically. However, sometimes, it's not perfect. Sometimes, changes are not refreshed automatically and sometimes it does. When changes are not refreshed, I have to re-run 'ng serve' which wastes a lot of time.

Do you have any way to know in what cases changes are refreshed automatically and when they are not? Also, if I see that I have to re-run 'ng serve', is there any faster way to refresh the project?

Best Answer

I was having the same issue, Angular CLI AutoCompile was not working, I used this command which resolved the issue

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

It may help you :)