Skip to content
This repository was archived by the owner on Apr 2, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
9 changes: 6 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}>;

Expand All @@ -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 }
];

}
Expand Down
11 changes: 10 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 0 additions & 14 deletions src/pages/home/home.module.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/pages/home/home.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/list/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<ion-content>
<ion-list>
<button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">
<ion-icon [name]="item.icon" item-left></ion-icon>
<ion-icon [name]="item.icon" item-start></ion-icon>
{{item.title}}
<div class="item-note" item-right>
<div class="item-note" item-end>
{{item.note}}
</div>
</button>
Expand Down
14 changes: 0 additions & 14 deletions src/pages/list/list.module.ts

This file was deleted.

5 changes: 2 additions & 3 deletions src/pages/list/list.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
});
}
Expand Down