Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
How to provide NbDateService from nebular? NullInjectorError with NbDateService

I'm building a custom calendar, and I extend from NbCalendarDayCellComponent<Date>. I need to inject other services to my customCellComponent but if I do that, I need to inject NbDateService and I receive the following error:

ERROR NullInjectorError: R3InjectorError(AppModule)[NbDateService -> NbDateService -> NbDateService]: NullInjectorError: No provider for NbDateService

I tried adding different modules and didn't work.

Calendar Kit Module

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

In your app.module.ts add:

// ...
import { NbDatepickerModule } from '@nebular/theme';
// ...
@NgModule({
  //...
  imports: [
        NbDatepickerModule,
  ],
  //...
})

Then on your CustomCellDayComponent it will work this:

export class CustomCellDayComponent extends NbCalendarDayCellComponent<Date> 
                                    implements OnInit, OnDestroy {
constructor(public nbDateService: NbDateService<Date>,){
    super(nbDateService);
  }
}
over 4 years ago · Santiago Trujillo Report

0

You can try to add a provider NbDateService in App.module.ts

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    NgxGenericTableModule,
    BrowserAnimationsModule
  ],
  providers: [
    NbDateService  // Add provider in your app.module
  ],
  bootstrap: [AppComponent]
})
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!