Typescript Error Ionic 2

Asked

Viewed 139 times

3

Following Error:

Type 'typeof Loginpage' is not Assignable to type 'typeof Homepage'.

Code:

import { LoginPage } from '../pages/login/login';

if(user) {
  this.rootPage = HomePage;
} else {
  this.rootPage = LoginPage; // Erro nessa linha
}
  • What kind of this.rootPage and which classes HomePage and LoginPage extend?

2 answers

0

0


Only tidy variable declaration:

import { LoginPage } from '../pages/login/login';

let rootPage:Any;

if(user) {
  this.rootPage = HomePage;
} else {
  this.rootPage = LoginPage; // Erro nessa linha
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.