jump to navigation

Including Angular Scripts From the Google CDN May 31, 2014

Posted by Tournas Dimitrios in AngularJs.

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 : 


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s