Closed skywalkerdark closed 4 years ago
You can try import picker-module in your root application module by calling setLocale()
. That should work
Thank you @AlexanderKiriluyk , worked perfectly!
I got the same error in angular v9 with ivy and the setLocal method doesn't help me. installed version : 5.4.2
ERROR NullInjectorError: R3InjectorError(AppModule)[InjectionToken TimeLocale -> InjectionToken TimeLocale -> InjectionToken TimeLocale]:
NullInjectorError: No provider for InjectionToken TimeLocale!
@Agranom Is there any quick workaround?
Not sure. I'll update to 9 angular this week and check
Updated the repo to ng9 and checked. Working without errors. You can see it on the demo page
@Agranom I see a commit with update. Have you update the NPM version?
@OLDIN Yes. Try the latest version
@Agranom I have the same issue on Angular@9.1 and ngx-material-timepicker@5.5.0. but I used ngx-timepicker-field and @AlexanderKiriluyk's solution not worked for me. and the v4.0.2 is working
Temporary fix, but very badly
This can be fixed by explicitly specifying TIME_LOCALE in your app.module.ts:
{
provide: TIME_LOCALE,
useValue: ''
}
Full example with import:
import { ɵe as TIME_LOCALE } from 'ngx-material-timepicker'; // nice import :D
@NgModule({
imports: [],
providers: [
{
provide: TIME_LOCALE,
useValue: ''
}
],
bootstrap: [AppComponent],
})
export class AppModule {}
@mahdiprog can you provide with a code snippet how you use it, because it works well with ng9 for me
For now it fixes by importing NgxMaterialTimepickerModule
into a root module
Seems to be fixed in v5.5.2
ERROR NullInjectorError: R3InjectorError(AppModule)[InjectionToken TimeLocale -> InjectionToken TimeLocale -> InjectionToken TimeLocale]: NullInjectorError: No provider for InjectionToken TimeLocale!
What is TimeLocale and where can I find it?