Promise in app.component constructor is not resolved before loading page


Im building an app with Ionic 4. I have a Storage promise in my app.component constructor. It works fine when hard-reloading the app (in the browser), but when the app live reloads on changes, the promise in the constructor is not resolved before the “checklist” page is rendered and then it fails because the user isn’t set yet.


import { Component } from '@angular/core';
import { Platform} from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { Router } from "@angular/router";
import { Storage } from '@ionic/storage';
import { UserService } from "./services/user.service";

  selector: 'app-root',
  templateUrl: 'app.component.html'
export class AppComponent {
    private platform: Platform,
    private splashScreen: SplashScreen,
    private statusBar: StatusBar,
    private router: Router,
    private storage: Storage,
    private userService: UserService,
  ) {'user').then((user) => {
      if(user) {
        this.userService.user = user;
      } else {

  initializeApp() {
    this.platform.ready().then(() => {


import { Component, OnInit } from '@angular/core';
import {UserService} from "../services/user.service";
import {User} from "../models/user";

  selector: 'app-checklist',
  templateUrl: './',
  styleUrls: ['./'],
export class ChecklistPage implements OnInit {

  user: User;

      private userService: UserService,
  ) {
    this.user = this.userService.user;

  ngOnInit() {


I know that I might can use the Guard-concept, but what if I also need other stuff from Storage before loading a page?

I used the same kind of approach in a ionic 3 app and that didn’t cause any issues :expressionless: