/* global angular */
(function(){
    angular.module("googlechart")
        .provider("agcLibraryLoader", AgcLibraryLoaderProvider);

    AgcLibraryLoaderProvider.$inject = ["$injector"];

    function AgcLibraryLoaderProvider($injector){

        this.$get = function(loader){
            return loader;
        }

        this.setLoader = function(loaderName){
            loaderName = loaderName.charAt(0).toUpperCase() + loaderName.slice(1);
            if ($injector.has(this.getProviderName(loaderName)))
                this.$get.$inject = [this.getProviderName(loaderName)];
            else
                console.warn("AGC loader type doesn't exist. Defaulting to JSAPI.");
        }

        this.getProviderName = function(loaderName){
            return "agc" + loaderName + "Loader";
        }

        this.setLoader("Jsapi");
    }
})();

@@ -233,16 +233,55 @@
 ctor)%7B%0A%0A
+        var DEFAULT_LOADER = %22Jsapi%22;%0A%0A
         
@@ -399,91 +399,8 @@
 e)%7B%0A
-            loaderName = loaderName.charAt(0).toUpperCase() + loaderName.slice(1);%0A
     
@@ -548,16 +548,18 @@
     else
+ %7B
 %0A       
@@ -585,126 +585,347 @@
 rn(%22
-AGC loader type doesn't exist. Defaulting to JSAPI.%22);%0A        %7D%0A%0A        this.getProviderName = function(loaderName)%7B
+%5BAngular-GoogleChart%5D Loader type %5C%22%22 + loaderName + %22%5C%22 doesn't exist. Defaulting to JSAPI loader.%22);%0A                this.$get.$inject = %5Bthis.getProviderName(DEFAULT_LOADER)%5D;%0A            %7D%0A        %7D%0A%0A        this.getProviderName = function(loaderName)%7B%0A            loaderName = loaderName.charAt(0).toUpperCase() + loaderName.slice(1);
 %0A   
@@ -1005,23 +1005,30 @@
 tLoader(
-%22Jsapi%22
+DEFAULT_LOADER
 );%0A    %7D

Fix behaviour of library loader when loader strategy does not exist.