Skip to content

Instantly share code, notes, and snippets.

@fireflysemantics
Created September 7, 2022 20:43
Show Gist options
  • Save fireflysemantics/d9d3755382f0969f98f75b661cd77927 to your computer and use it in GitHub Desktop.
Save fireflysemantics/d9d3755382f0969f98f75b661cd77927 to your computer and use it in GitHub Desktop.
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