2016-08-19 105 views
0

试图从起始页面导航(我使用侧面菜单而不是标签)。 导航似乎工作,但只有按下按钮两次后(旧的页面不离开DOM,但新的页面构造函数触发,并将页眉替换为页面,然后我可以再次按导航按钮,哪个。-runs它的页面逻辑和渲染页面的其余部分我们已经附上一些截图:Ionic 2页面导航不起作用

这是主登录: This is the main login:

按下该按钮后登录,接下来的几页的逻辑运行,标题改变,但旧页面没有离开 enter image description here

我可以按l ogin再次,下一页逻辑再次运行,然后呈现页面。 enter image description here

下面的代码:

login(){ 
    this.refToProgram.loggedIn = true; 

    this.nav.push(NearmePage).then(
     response => { 
     console.log('Response ' + response); 
     }, 
     error => { 
     console.log('Error: ' + error); 
     } 
    ).catch(exception => { 
     console.log('Exception ' + exception); 
    }); 
} 

这样做的结果是:“应对真正的” 这意味着离子认为,导航是成功的,我缺少什么?

回答

0

尝试与[navPush]= "nearmePage";导航里面的登录按钮

内部控制器

插入nearmePage类和您的LoginPage类中

声明nearmePage = "NearmePage"以便将采取推崇网页形式登陆第