core
core copied to clipboard
Configuration: defaultLanguage in TranslateModule.forRoot as a Provider
Current behavior
One of the configuration parameter for the TranslateModule.forRoot is the defaultLanguage parameter. Now it is a string value.
Expected behavior
Transform the defaultLanguage parameter into a provider so we can assign to it a value using for example a Factory.
What is the motivation / use case for changing the behavior?
In my application the value of the defaultLanguage is the result of a algorithm implemented by a function. Now I set the defaultLanguage in the main app component logic, but I think it's not a good practice to have initialization parameters in two different places, the main app component logic and the TranslateModule.forRoot.
Thank you.