Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular - CDN reference works, local min file does not

I have an HTML file with some Javascript in it. I'm using Angular.js. If I reference the CDN, like this:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>

everything works fine. If I try to use a local angular.js or angular.min.js file, the Angular functions break:

<script src="../Javascript/angular.js"></script>

Is there a known reason for this? Nothing else changes. My problem is that I'm not sure if my code can get to the CDN where I'm deploying it. The Angular functions aren't working in the deployment location with the CDN reference, and I want to test with the local reference, but I can't get it working in dev in the first place.

like image 474
Andrew B Schultz Avatar asked Nov 12 '22 17:11

Andrew B Schultz


1 Answers

Download latest version of angular from here Download

And include Angular.js file in head tag

<src href="path/to/angular.js" ></script>

To check file loaded or not go to console (F12) and click on network .

I hope this may help you .

Download latest version of angular from here Download

like image 111
Nishchit Avatar answered Nov 15 '22 03:11

Nishchit