Created
December 25, 2018 14:42
-
-
Save chsami/47d29c9e410f4dcb2fdb874f002e909f 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