Created
December 25, 2018 14:40
-
-
Save chsami/28f75b8ef46f40ee0e08c00243a5a0e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class MapModule { | |
| //create a static function with the mapConfig as a parameter | |
| static forRoot(mapConfig: IMapsConfig): ModuleWithProviders { | |
| return { | |
| ngModule: MapModule, | |
| //We provide a MapsConfig InjectionToken, which we later can use in our service to use | |
| providers: [ {provide: MapsConfig, useValue: mapConfig} ] | |
| }; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment