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

271
Visualizações
ngOnInit() not being invoked - even first time running the Ionic app

For an Ionic App that has implemented OnInit why is ngInit() not invoked? It is not happening even the first time the app/window is opened:

export class AudioRecorderComponent implements OnInit, OnDestroy {
   ...
  async ngOnInit() {
    console.log('ngOnInit()')  // never printed 
   ...

}

Is there a different way to get logic to be executed when creating an Ionic component?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

While in theory ngOnInit should work, try using viewWillEnter instead.

https://ionicframework.com/docs/angular/lifecycle

export class AudioRecorderComponent implements viewWillEnter {

 ionViewWillEnter(): void {

     console.log('view will enter');
 }

}
about 4 years ago · Juan Pablo Isaza Relatório

0

This was due to the GoogleVoice extension. After disabling the extension the ngOnInit() proceeded correctly

about 4 years ago · Juan Pablo Isaza 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