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

280
Views
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 answers
Answer question

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 Report

0

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

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