简体   繁体   中英

ASP.NET Core MVC + Angular SPA Template + Docker Support: Changing html content does not refresh live on the browser

Scenario: I created an ASP.NET Core 2.1 project in Visual Studio 2017. I selected the Angular SPA template and then added Docker Orchestration Support.

Expected Result: When running the application in debug mode in a container, I expect the changes I am making in the html content to be visible on the browser when I hit refresh.

Actual Result: Live Preview is not working. I do know that if I run the application on localhost, Live Preview works. I also know that regular ASP.NET MVC Core apps without Angular, running in a container also support live preview.

Is there something I am missing or Live Preview is not supposed to work for my scenario? If that is true it is unfortunate because if I have to rebuild the container every time I make a UI change I will lose a lot of time.

I was able to get the live updating of changes to Angular pages with Docker support in Visual Studio 2017 by using:

ng build --watch

instead of:

ng serve --watch

I no longer have to run

ng build

after every change.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM