Change the start page of the blank template


#1

Hi,

I want to be able to change the default start page of my starter app.

At the moment it just defaults to page1.html of the tabs.

I want to be able to set a start page with no navbar or tabs footer. I just need a login page that when i click the button it then takes you to the page.1html with the tabs…

Any ideas? Thanks


#2

Sorry, I didn’t realize you were working with ionic 2…


#3

This is my app.js file:

import 'es6-shim';
import {App, Platform} from 'ionic-angular';
import {StatusBar} from 'ionic-native';
import {TabsPage} from './pages/tabs/tabs';

@App({
  template: '<ion-nav [root]="rootPage"></ion-nav>',
  config: {} // http://ionicframework.com/docs/v2/api/config/Config/
})
export class MyApp {
  static get parameters() {
    return [[Platform]];
  }

  constructor(platform) {
    this.rootPage = TabsPage;

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();
    });
  }
}

New to ionic 2 and angular would you be able to guide me a little to get this working? within pages, i have a login folder, so im guessing i want my default page to be the login then when i click the button i will see the tabs


#4

rootPage - it is the start page


#5

That worked :slight_smile: Thanks

Now I have the login page working, when I click on the button how would you link to the first tab?

Does ui-sref still work?

<button ui-sref="TabsPage" class="button button-block button-positive button-large">Log in </button>

Tabs page is
import {TabsPage} from './pages/tabs/tabs';


#6

Use docs:

nav.push(TabsPage)

PS ui-router doesn’t work in Angular 2


#7

Im guessing you dont add that code snippet to the actual HTML button?

Cant get that working still confused with ionic 2 and angular 2, much prefer the simpler ui-sref to quickly link up pages.

I’ll have a read of the docs, thanks for your help