angular7

How to make DateAdapter singleton in angular 2 app?

你。 提交于 2020-12-04 04:54:49
问题 I'm developing an angular 7 application with lazy loaded modules. I'm using angular material components as well. I would like to localize and support multiple locales in datepicker component. I would like to change it globally for the whole application when application language changes. It may be done via DateAdapter.setLocale method. However the problem is that if I change it on my root module then it does not change in lazy loaded modules. Yes, lazy loaded modules have their injector and

How to make DateAdapter singleton in angular 2 app?

余生颓废 提交于 2020-12-04 04:54:09
问题 I'm developing an angular 7 application with lazy loaded modules. I'm using angular material components as well. I would like to localize and support multiple locales in datepicker component. I would like to change it globally for the whole application when application language changes. It may be done via DateAdapter.setLocale method. However the problem is that if I change it on my root module then it does not change in lazy loaded modules. Yes, lazy loaded modules have their injector and