diff --git a/README.md b/README.md index eb66ebe..c88b781 100644 --- a/README.md +++ b/README.md @@ -1,26 +1 @@ -This is a starter template for [Ionic 2](http://ionicframework.com/docs/v2/) projects. - -## How to use this template - -*This template does not work on its own*. The shared files for each starter are found in the [ionic2-app-base repo](https://github.com/driftyco/ionic2-app-base). - -To use this template, either create a new ionic project using the ionic node.js utility, or copy the files from this repository into the [Starter App Base](https://github.com/driftyco/ionic2-app-base). - -### With the Ionic CLI: - -Take the name after `ionic2-starter-`, and that is the name of the template to be used when using the `ionic start` command below: - -```bash -$ sudo npm install -g ionic cordova -$ ionic start mySideMenu sidemenu --v2 -``` - -Then, to run it, cd into `mySideMenu` and run: - -```bash -$ ionic platform add ios -$ ionic run ios -``` - -Substitute ios for android if not on a Mac. - +### :point_right: This starter repo has moved to the [ionic-team/starters](https://github.com/ionic-team/starters/tree/master/ionic-angular/official/sidemenu) repo! :point_left: diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c836ac4..9adbbfc 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,13 +3,16 @@ import { Nav, Platform } from 'ionic-angular'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; +import { HomePage } from '../pages/home/home'; +import { ListPage } from '../pages/list/list'; + @Component({ templateUrl: 'app.html' }) export class MyApp { @ViewChild(Nav) nav: Nav; - rootPage: any = 'HomePage'; + rootPage: any = HomePage; pages: Array<{title: string, component: any}>; @@ -18,8 +21,8 @@ export class MyApp { // used for an example of ngFor and navigation this.pages = [ - { title: 'Home', component: 'HomePage' }, - { title: 'List', component: 'ListPage' } + { title: 'Home', component: HomePage }, + { title: 'List', component: ListPage } ]; } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index eec3d08..c61a9c2 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,19 +3,28 @@ import { ErrorHandler, NgModule } from '@angular/core'; import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; import { MyApp } from './app.component'; +import { HomePage } from '../pages/home/home'; +import { ListPage } from '../pages/list/list'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; @NgModule({ declarations: [ - MyApp + MyApp, + HomePage, + ListPage ], imports: [ BrowserModule, IonicModule.forRoot(MyApp), ], bootstrap: [IonicApp], + entryComponents: [ + MyApp, + HomePage, + ListPage + ], providers: [ StatusBar, SplashScreen, diff --git a/src/pages/home/home.module.ts b/src/pages/home/home.module.ts deleted file mode 100644 index 934517e..0000000 --- a/src/pages/home/home.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { HomePage } from './home'; - -@NgModule({ - declarations: [ - HomePage, - ], - imports: [ - IonicPageModule.forChild(HomePage), - ] -}) -export class HomePageModule {} \ No newline at end of file diff --git a/src/pages/home/home.ts b/src/pages/home/home.ts index 16b60db..1d510dd 100644 --- a/src/pages/home/home.ts +++ b/src/pages/home/home.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; -import { IonicPage, NavController } from 'ionic-angular'; +import { NavController } from 'ionic-angular'; -@IonicPage() @Component({ selector: 'page-home', templateUrl: 'home.html' diff --git a/src/pages/list/list.html b/src/pages/list/list.html index 73a63f1..f019c85 100644 --- a/src/pages/list/list.html +++ b/src/pages/list/list.html @@ -10,9 +10,9 @@ diff --git a/src/pages/list/list.module.ts b/src/pages/list/list.module.ts deleted file mode 100644 index b0244c2..0000000 --- a/src/pages/list/list.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { ListPage } from './list'; - -@NgModule({ - declarations: [ - ListPage, - ], - imports: [ - IonicPageModule.forChild(ListPage), - ] -}) -export class ListPageModule {} \ No newline at end of file diff --git a/src/pages/list/list.ts b/src/pages/list/list.ts index 1235909..a421ca9 100644 --- a/src/pages/list/list.ts +++ b/src/pages/list/list.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; -import { IonicPage, NavController, NavParams } from 'ionic-angular'; +import { NavController, NavParams } from 'ionic-angular'; -@IonicPage() @Component({ selector: 'page-list', templateUrl: 'list.html' @@ -31,7 +30,7 @@ export class ListPage { itemTapped(event, item) { // That's right, we're pushing to ourselves! - this.navCtrl.push('ListPage', { + this.navCtrl.push(ListPage, { item: item }); }