回答

1

不,像$http一個服務不能被注入提供商配置部分。相反,你可以考慮以下解決方案:

  • 負載配置數據
  • 一旦數據被加載,通過uiGmapGoogleMapApi提供商配置Goolgle地圖加載器
  • 手動引導應用

angular.element(document).ready(function() { 
    $.getJSON('settings.json') 
    .then(function (configData) { 
     angular.module('myApp') 
     .config(['uiGmapGoogleMapApiProvider', function (uiGmapGoogleMapApiProvider) { 
     uiGmapGoogleMapApiProvider.configure(configData); 
     }]); 
     angular.bootstrap('#myApp', ['myApp']); 
    }); 
}); 

Demo: plunker