I have a function to detect current locale and I need to set the locale at angular 2 rooot App module via provider. so that i can use that in all other components.
I know i can able to do this like below.
{ provide: 'Locale', useValue: 'en-US' }
But i want to do something like this below if possible.
{ provide: 'Locale', useValue: this.detectLocale() }
Otherwise Please suggest any suitable way to achieve this. Thanks.