Hi Team,
For every page in ionic 3 , URL is not changing. Each time I am refreshing it get back to my login page and Even I am unable to share link to my particular page.
Is there any way to get URL as well for each page???
Thanks
Hi Team,
For every page in ionic 3 , URL is not changing. Each time I am refreshing it get back to my login page and Even I am unable to share link to my particular page.
Is there any way to get URL as well for each page???
Thanks
Actually want you want to do?
Hey
By using segment
@IonicPage({
segment:“modesto”
})
I am able to get url in browser
http://localhost:8100/#/login
but after login page I am using Side menu page then url become
http://localhost:8100/#/sidemenu/mypage
then when Ia again navigating to login page (on logout)
url become http://localhost:8100/#/sidemenu/login
but it is wrong it should be like http://localhost:8100/#/login
Got my problem???
You can try like this.
import {IonicApp, Page, NavController, MenuController} from 'ionic/ionic';
import {TabsPage} from '../tabs/tabs';
import {SignupPage} from '../signup/signup';
import {UserData} from '../../providers/user-data';
@Page({
templateUrl: 'build/pages/login/login.html'
})
export class LoginPage {
constructor(nav: NavController, userData: UserData, menu: MenuController) {
this.nav = nav;
this.userData = userData;
this.login = {};
this.submitted = false;
this.menu = menu;
}
onLogin(form) {
this.submitted = true;
if (form.valid) {
this.userData.login(); this.nav.push(TabsPage);
}
}
onSignup() {
this.nav.push(SignupPage);
}
onPageDidEnter() {
// the left menu should be disabled on the login page
this.menu.enable(false);
}
onPageDidLeave() {
// enable the left menu when leaving the login page
this.menu.enable(true);
}
}
this is nice but it will not solve the url problem.
by using this.appCtrl.getRootNav().setRoot(“LoginPage”) inside logout function I am able to manage correct url.