docs(demos): update api demos to modular structure

update api demos to modular structure
This commit is contained in:
Dan Bucholtz
2017-03-02 14:26:30 -06:00
parent 7281f020f4
commit 0fdff89b67
316 changed files with 3057 additions and 1896 deletions

View File

@ -0,0 +1,9 @@
import { Component } from '@angular/core';
import { PageOne } from '../pages/page-one/page-one';
@Component({
template: '<ion-nav [root]="root"></ion-nav>'
})
export class AppComponent {
root = PageOne;
}

View File

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../src';
import { AppComponent } from './app.component';
import { PageOneModule } from '../pages/page-one/page-one.module';
import { PageTwoModule } from '../pages/page-two/page-two.module';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(AppComponent),
PageOneModule,
PageTwoModule
],
bootstrap: [IonicApp]
})
export class AppModule {}

View File

@ -0,0 +1,5 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../src';
import { PageOne } from './page-one';
@NgModule({
declarations: [
PageOne,
],
imports: [
DeepLinkModule.forChild(PageOne),
],
entryComponents: [
PageOne,
]
})
export class PageOneModule {}

View File

@ -1,11 +1,11 @@
import { Component, NgModule } from '@angular/core';
import { IonicApp, IonicModule, LoadingController, NavController } from '../../ionic-angular';
import { Component } from '@angular/core';
import { LoadingController, NavController } from '../../../../../src';
import { PageTwo } from '../page-two/page-two';
@Component({
templateUrl: 'page.html'
templateUrl: 'page-one.html'
})
export class Page1 {
export class PageOne {
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoadingIos() {
@ -99,7 +99,7 @@ export class Page1 {
loading.present();
setTimeout(() => {
this.navCtrl.push(Page2);
this.navCtrl.push(PageTwo);
}, 1000);
setTimeout(() => {
@ -107,42 +107,3 @@ export class Page1 {
}, 4000);
}
}
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>This is another page!</ion-content>
`
})
export class Page2 {}
@Component({
template: '<ion-nav [root]="root"></ion-nav>'
})
export class ApiDemoApp {
root = Page1;
}
@NgModule({
declarations: [
ApiDemoApp,
Page1,
Page2
],
imports: [
IonicModule.forRoot(ApiDemoApp)
],
bootstrap: [IonicApp],
entryComponents: [
Page1,
Page2
]
})
export class AppModule {}

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../src';
import { PageTwo } from './page-two';
@NgModule({
declarations: [
PageTwo,
],
imports: [
DeepLinkModule.forChild(PageTwo),
],
entryComponents: [
PageTwo,
]
})
export class PageTwoModule {}

View File

@ -0,0 +1,13 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>This is another page!</ion-content>
`
})
export class PageTwo {}