Last active
February 6, 2020 07:53
-
-
Save santoshyadavdev/ef204839406e8c6877f3ce365f0c4dbb to your computer and use it in GitHub Desktop.
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 { Injectable, Inject } from '@angular/core'; | |
import { configToken } from './demo.token'; | |
import { Config } from './demo.config'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ConfigService { | |
constructor(@Inject(configToken) private config: Config) { | |
console.log('new instance is created'); | |
} | |
getValue() { | |
return this.config; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment