Skip to content

Instantly share code, notes, and snippets.

@abdel-ships-it
Created December 4, 2019 23:04
Show Gist options
  • Save abdel-ships-it/fcb755c76be0e3bc91ec9f3cba01cc03 to your computer and use it in GitHub Desktop.
Save abdel-ships-it/fcb755c76be0e3bc91ec9f3cba01cc03 to your computer and use it in GitHub Desktop.
import { NgModule, LOCALE_ID} from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { LocaleService } from './locale.service';
@NgModule({
imports: [BrowserModule],
declarations: [AppComponent],
bootstrap: [AppComponent],
providers: [
LocaleService,
{
provide: LOCALE_ID,
deps: [LocaleService],
useFactory: ($locale: LocaleService) => $locale.get()
}]
})
export class AppModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment