title: Angular 7 LOCALE_ID Injection using plain old objects
body: <p>Im working with locale injection and i am able to inject it in the constructor, i was wondering if its possible to inject it as a property. This will bring me to my next question can i inject this in a plain model. I am using <code>class-transformer</code> to map http results to usable objects. I can create a locale.ts file that i can map to different builds and such so i have a usable work around but i would like to do this the most correct way</p>
  
  <pre><code>export class AppComponent implements OnInit {  
  
    @Inject(LOCALE_ID) public localeProperty: string;
  
    constructor(@Inject(LOCALE_ID) public locale: string, public appService: AppService) {
    }
  
    ngOnInit() {
  
      console.log('AppComponent.locale: ', this.locale);
      console.log('AppComponent.localeProperty: ', this.localeProperty);
  </code></pre>
  
  <blockquote>
    <p>AppComponent.locale:  fr </p>
    
    <p>AppComponent.localeProperty:  undefined</p>
  </blockquote>
  
  <p>In my Location model i want the model to know what label to use, ideally i want to be able to inject the LOCALE_ID</p>
  
  <pre><code>import {locale} from '../../environments/locale';
  
  
  export class Location {
  
    enLabel: string;
    frLabel: string;
  
    // can i do something here
    constructor() {
    }
  
    get label() {
      return this[`${locale}Label`] ? this[`${locale}Label`] : this.enLabel;
    }
  </code></pre>
  
  <p><strong>git here</strong>
  <a href="https://github.com/ricardosaracino/class-transformer" rel="nofollow noreferrer">https://github.com/ricardosaracino/class-transformer</a></p>