I'm using Angular JS on ASP.NET MVC 4 and I am using script bundles to load from a cdn and also load from the origin server in case of a cdn failure like so:
var jQuery = new ScriptBundle("~/bundles/scripts/jquery",
"//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js") // CDN
.Include("~/Scripts/jquery-{version}.js"); // Local fallback
jQuery.CdnFallbackExpression = "window.jQuery"; // Test existence
bundles.Add(jQuery);
and
var angular = new ScriptBundle("~/bundles/scripts/angular",
"//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js")
.Include("~/Scripts/angular.js");
angular.CdnFallbackExpression = "window.angular";
bundles.Add(angular);
It is fairly easy to detect if jQuery or AngularJS exist using window.jQuery and window.Angular respectively. The ASP.NET bundling mechanism evaluates the CdnFallbackExpression text to see if it needs to fall back to the origin server.
However, in later versions of AngularJS, other modules such as ngRoute and ngResource are separated into their own files to be loaded at the developers discretion.
How do I detect if other AngularJS modules are loaded? What could I type in the console to see if ngAnimate, ngRoute, ngResource, etc. succeeded in loading from the CDN?