Last active
September 2, 2018 12:57
-
-
Save GrandSchtroumpf/7789360e07386245634e57c7b8cf3853 to your computer and use it in GitHub Desktop.
A module to provide the URI of an Ethereum node
This file contains 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
import { NgModule, ModuleWithProviders, InjectionToken} from '@angular/core'; | |
export const URL = new InjectionToken<string>('url'); | |
@NgModule({ | |
imports: [HttpClientModule] | |
}) | |
export class ProviderModule { | |
static init(url: string): ModuleWithProviders { | |
return { | |
ngModule: ProviderModule, | |
providers: [{ provide: URL, useValue: url }] | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment