Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

feat(LazyMapsAPILoader): provide shortcut#420

Closed
sebholstein wants to merge 1 commit into
masterfrom
loader-shortcut
Closed

feat(LazyMapsAPILoader): provide shortcut#420
sebholstein wants to merge 1 commit into
masterfrom
loader-shortcut

Conversation

@sebholstein

Copy link
Copy Markdown
Owner

Now, you can use a shortcut to configure the LazyMapsAPILoader:

Before:

bootstrap(AppComponent, [
  ANGULAR2_GOOGLE_MAPS_PROVIDERS,
  provide(LazyMapsAPILoaderConfig, {useFactory: () => {
    let config = new LazyMapsAPILoaderConfig();
    config.apiKey = 'mykey';
    return config;
  }})
])

After:

import {provide} from 'angular2/core';
import {provideLazyMapsAPILoaderConfig} from
'angular2-google-maps/core';

bootstrap(AppComponent, [
  GOOGLE_MAPS_PROVIDERS,
  provideLazyMapsAPILoaderConfig({ apiKey: 'myKey' })
])

Closes #388

Now, you can use a shortcut to configure the LazyMapsAPILoader:

Before:
```typescript
bootstrap(AppComponent, [
  ANGULAR2_GOOGLE_MAPS_PROVIDERS,
  provide(LazyMapsAPILoaderConfig, {useFactory: () => {
    let config = new LazyMapsAPILoaderConfig();
    config.apiKey = 'mykey';
    return config;
  }})
])
```

After:
```typescript
import {provide} from 'angular2/core';
import {provideLazyMapsAPILoaderConfig} from
'angular2-google-maps/core';

bootstrap(AppComponent, [
  GOOGLE_MAPS_PROVIDERS,
  provideLazyMapsAPILoaderConfig({ apiKey: 'myKey' })
])
```
@sebholstein sebholstein added this to the 0.11.0 milestone Jun 11, 2016
@ghost ghost deleted the loader-shortcut branch September 17, 2019 11:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant