Skip to content

Instantly share code, notes, and snippets.

@santoshyadavdev
Last active February 6, 2020 07:53
Show Gist options
  • Save santoshyadavdev/ef204839406e8c6877f3ce365f0c4dbb to your computer and use it in GitHub Desktop.
Save santoshyadavdev/ef204839406e8c6877f3ce365f0c4dbb to your computer and use it in GitHub Desktop.
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