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
}
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
}
0
Declare:
rootPage: any;
Confirm what is the data type of the attribute rootPage
. As in this case you will only know which component will be running time you need to pass at build time.
Typescript Docs - Any: https://www.typescriptlang.org/docs/handbook/basic-types.html#any
This is a very interesting project to use as an example of code: https://github.com/driftyco/ionic-conference-app
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 ionic ionic2
You are not signed in. Login or sign up in order to post.
What kind of
this.rootPage
and which classesHomePage
andLoginPage
extend?– Genos