vendredi 24 octobre 2014

AngularJS - Resource interpreted as Script but transferred with MIME type text/html javascript

When you try to retrieve the JS file from CDN, if you get the error  Resource interpreted as Script but transferred with MIME type text/html javascript. It means that the source from where you are trying to get the code does execute a text/html instead of text/javascript or application/javascript.

You do better to access the direct source from you browser and get.

This problem occurs too when you want to refer to the Angular UI Bootstrap using this link
https://github.com/angular-ui/bootstrap/blob/gh-pages/ui-bootstrap-tpls-0.11.2.js
The link was pointing to a text file.

What I did to solve the issue was to download the entire file in a zip format here then unzipped and located the ui-bootstrap-tpls-0.11.2.js

I hope this could save life ;)