Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

297
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda