I get this error:
XMLHttpRequest cannot load http://otherwebsite.com/myapp/app/main.js. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://otherwebsite.com' is therefore not allowed access.
when referencing a main.js file in Angular2:
But no other .js files require CORS pulled from the other site.
I know how to add CORS support for Web API 2 for methods but this is not a method. I know how to add CORS support for Apache folders in .htaccess files. And with a little digging I found how to add IIS 7 CORS folder support that made this error go away.
Buy why would Angular2 need CORS for my main.js when all the other .js files loaded without CORS issues?