I have a Visual Studio Community 2017 (15.2) project with AngularJS 1.6.5 and a NancyFX server.
Code here:
https://github.com/GusBeare/NancyAngularTests
This is a playground for me to learn and test features I'd like to use on a real project.
All the AngularJS stuff is in Typescript files and my tsconfig.json tells the compiler to compile it all into a single JS file Content/js/bundle.js
.
When I build and run the project everything works as expected and there are no issues. However, if I edit a .ts file while the app is running it breaks with this error:
angular.min.js:7 Uncaught Error: [$injector:nomod]
http://errors.angularjs.org/1.6.5/$injector/nomod?p0=mySPA
The compile on save seems to work fine since the Content/js/bundle.js
is rebuilt on save. But why do I get the Angular error only on compile on save?
Am I doing something wrong in my AngularJS code or is this a Typescript/Visual Studio thing?
If I build and publish the project it runs fine under IIS and I can't break it.