I started Ionic 3 with the base template “Tabs”. I created the pages and link them to navigation that’s ok.
But now, if I want to do a new page (like a login one and a presentation page) they will have the nav Tabs, right ?
My questions are "How to simply add a page without any template (basically a blank page that I can edit/add some stuff) ? and a link to my “Tabs” template ?
Thank’s for your help !
LoginPage (I’d change Login class to LoginPage for clarity, in line with HomePage, TabsPage etc), notice new import lines and @ViewChild then this.nav.setRoot()
import { Component } from '@angular/core';
import { Nav } from 'ionic-angular';
import { TabsPage } from '../pages/tabs/tabs';
@Component({
selector: 'page-login',
templateUrl: 'login.html'
})
export class LoginPage {
@ViewChild(Nav) nav: Nav;
constructor() { }
goToTabs(){
this.nav.setRoot(TabsPage);
}
}
Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.
Sorry I missed an import. If you ever have an issue like this it’s always an idea to look up the documentation and find an example of it’s usage and 9/10 it’s something simple like this
@Sheepish I tried to test the link between this page and the navigation tabs but i’ve an error “Cannot read property ‘setRoot’ of undefined”. I probably miss something but I cannot figured out where (Sorry I’m a newbie with Ionic).