When using Angular JS with ASP.NET MVC 4, I utilize script bundles to load from a CDN and also fallback to the origin server in case of CDN failure:
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"; // Check 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);
Determining whether jQuery or AngularJS is loaded is simple with window.jQuery and window.Angular. The ASP.NET bundling system evaluates the CdnFallbackExpression text to determine if it should fall back to the origin server.
However, newer versions of AngularJS have separate modules like ngRoute and ngResource which need to be loaded at the developer's discretion.
How can we check if other AngularJS modules are loaded? What commands could we use in the console to verify if ngAnimate, ngRoute, ngResource, etc. were successfully loaded from the CDN?