angular-google-maps API key from backend

2019-08-03 07:36发布

Generally, this question is about how to use some dynamic content from a backend inside a module.config function in AngularJS.

Specifically, this question is regarding the GoogleMapApi provider in angular-google-maps

In my Angular Application the Google Maps API key is stored in a Firebase backend. What I would like to do is to set the API key for the GoogleMapApiProvider

.config(function(uiGmapGoogleMapApiProvider) {
    uiGmapGoogleMapApiProvider.configure({
    key: 'your api key',
    }); 
})

I know that I only have Providers and Constants available in the Angular module config function. So I struggle to think of a way to get the necessary API key from my Firebase backend using the $firebaseProvider Any help or direction is most appreciated! Thanks!

0条回答
登录 后发表回答