Search code examples
javascriptionic-framework

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?


Solution

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