Created
September 7, 2022 20:43
-
-
Save fireflysemantics/d9d3755382f0969f98f75b661cd77927 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
import { Inject, Injectable } from '@angular/core'; | |
import { GreetingServiceConfig } from './greeting-service.config'; | |
import { GREETING_SERVICE_CONFIG_INJECTION_TOKEN } from './greeting-service.token'; | |
@Injectable() | |
export class GreetingService { | |
constructor( | |
@Inject(GREETING_SERVICE_CONFIG_INJECTION_TOKEN) | |
private config: GreetingServiceConfig | |
) {} | |
public initialize() { | |
this.salutation = `${this.config.greeting} ${this.config.subject}!`; | |
} | |
public greeting(message: string): string { | |
return `${this.config.greeting} ${message}!`; | |
} | |
public salutation: string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment