move your search out of the constructor and onto ionViewDidLoad()
That’s really interesting, thank you. I’ve moved all operations out of constructors and into ngOnInit(), but maybe ionViewDidLoadI() is even better. I’ll play around with it.
Constructor is empty and also ionViewDidLoad() is empty.
In home.ts only one method is there showSearchCompanies() which is been called on click from home.html.
I had the same problem, and I fixed it by moving things out of constructors on other pages and the app module. Went from 20+ seconds on a non-prod build to ~4 seconds. Now I don’t have to use the --prod flag while in dev. I’m not entirely sure of the order of operations but I think it might be the case that some pages or services are constructed before the home page is rendered (for navigation setup?). So if you have something blocking elsewhere it can affect your homepage even when there’s nothing going on your homepage specifically.
I checked and everything seems to be alright.
This is tabs.ts
import { Component } from ‘@angular/core’;
import { HomePage } from ‘…/home/home’;
import { AboutPage } from ‘…/about/about’;
import { ContactPage } from ‘…/contact/contact’;
@Component({
templateUrl: ‘tabs.html’
})
export class TabsPage {
// this tells the tabs component which Pages
// should be each tab’s root Page
tab1Root: any = HomePage;
tab2Root: any = AboutPage;
tab3Root: any = ContactPage;