Delay Splash Untill Some Operation is Done


#1

How can we delay the splash screen untill some operation is done? i have tried below code but it creates a white flash between pages…

@Component({
  selector: "gr-main",
  template: `<GridLayout *ngIf='isInitialized'><page-router-outlet></page-router-outlet></GridLayout>`
})
export class AppComponent { 
  isInitialized = false;

  constructor(private dbService: DbService) {
    
    //initialize db
    setTimeout(() => {
      this.dbService.getDatabase();
      this.isInitialized = true;
      console.log('---------scheme generated---------------');
    }, 3000);
  }
}

#2

bootstrapModule is what initiates the application, so you may try making your updates outside Angular context and then bootstrap your module Or simply place a image that resembles your splash screen in app component while you finish updates, you can even add a activity indicator to show your app is not stuck but loading with second approach.