Search code examples
angularnebular

Nebular Time Picker throwing 'nb-timepicker' is not a known element?


I'm trying to implement nebular TimePicker component in my Angular 8 project, and I followed the Nebular Documentation mentioned here:

https://akveo.github.io/nebular/docs/components/timepicker

But they didn't mention How can I import timepicker module into my project?, I tried this

import 'NbTimepickerModule' from '@nebular/theme';

but this error raised:

Module "../../node_modules/@nebular/theme" has no exported member ‘NbTimepickerModule’. Did you mean ‘NbDatepickerModule’?

Thanks in advance


Solution

  • Timepicker is not part of all nebular version.

    Nebular Changelog

    Timepicker is only available on v6.1+.

    Extra

    Your imports should look like this

    //app.module
    import { NbTimepickerModule } from '@nebular/theme';
    ...
    imports: [
      ...
      NbTimepickerModule.forRoot(),
    ],
    ...
    
    
    //your submodule.module
    import { NbTimepickerModule } from '@nebular/theme';
    ...
    imports: [
      ...
      NbTimepickerModule;
    ],
    ...