jump to navigation

Including Angular Scripts From the Google CDN May 31, 2014

Posted by Tournas Dimitrios in AngularJs.
add a comment

angular-logoThe number one reason for using a CDN is to improve our website visitor’s experience in terms of speed. As we know, site speed is a ranking factor in Google’s algorithm. The quickest way to get started is to point a <script>  tag to a Google CDN URL. There are two types of angular script URLs we can point to, one for development (angular.js –80Kb size–) and one for production (angular.min.js –30Kb size–) . While the development version (non-minified version) is suitable for web development and displays detailed error reporting messages, the production version (minified version) is the suggested.
A quick reference for the most used Angular scripts provided by Google’s CDN :

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script><script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-animate.min.js"></script><script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-cookies.min.js"></script><script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-resource.min.js"></script><script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-route.min.js"></script><script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-sanitize.min.js"></script><script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-touch.min.js"></script>

Those developers  who want to work with angular offline, or those who want to host the angular files on their own servers, have to navigate to https://code.angularjs.org/  and download all necessary scripts manually.

Code available as Gist 

Link :