mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
docs(demos): update api demos to modular structure
update api demos to modular structure
This commit is contained in:
9
demos/src/action-sheet/app/app.component.ts
Normal file
9
demos/src/action-sheet/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/action-sheet/app/app.module.ts
Normal file
19
demos/src/action-sheet/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/action-sheet/app/main.ts
Normal file
5
demos/src/action-sheet/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/action-sheet/pages/page-one/page-one.module.ts
Normal file
17
demos/src/action-sheet/pages/page-one/page-one.module.ts
Normal 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 {}
|
@ -1,11 +1,11 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { ActionSheetController, IonicApp, IonicModule, Platform } from '../../ionic-angular';
|
||||
import { Component } from '@angular/core';
|
||||
import { ActionSheetController, Platform } from '../../../../../src';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
export class PageOne {
|
||||
constructor(public alertCtrl: ActionSheetController, public platform: Platform) { }
|
||||
|
||||
present() {
|
||||
@ -55,26 +55,3 @@ export class ApiDemoPage {
|
||||
actionSheet.present();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
9
demos/src/alert/app/app.component.ts
Normal file
9
demos/src/alert/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/alert/app/app.module.ts
Normal file
19
demos/src/alert/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/alert/app/main.ts
Normal file
5
demos/src/alert/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/alert/pages/page-one/page-one.module.ts
Normal file
17
demos/src/alert/pages/page-one/page-one.module.ts
Normal 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 {}
|
@ -1,11 +1,10 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { AlertController, IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { AlertController } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
export class PageOne {
|
||||
testRadioOpen = false;
|
||||
testRadioResult: any;
|
||||
testCheckboxOpen = false;
|
||||
@ -208,25 +207,3 @@ export class ApiDemoPage {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: `<ion-nav [root]="root"></ion-nav>`
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
@ -1,32 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
9
demos/src/button/app/app.component.ts
Normal file
9
demos/src/button/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/button/app/app.module.ts
Normal file
19
demos/src/button/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/button/app/main.ts
Normal file
5
demos/src/button/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/button/pages/page-one/page-one.module.ts
Normal file
17
demos/src/button/pages/page-one/page-one.module.ts
Normal 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 {}
|
6
demos/src/button/pages/page-one/page-one.ts
Normal file
6
demos/src/button/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {}
|
@ -1,49 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
|
||||
data = {
|
||||
jon: true,
|
||||
daenerys: true,
|
||||
arya: false,
|
||||
tyroin: false,
|
||||
sansa: true,
|
||||
khal: false,
|
||||
cersei: true,
|
||||
stannis: true,
|
||||
petyr: false,
|
||||
hodor: true,
|
||||
catelyn: true,
|
||||
bronn: false
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
9
demos/src/checkbox/app/app.component.ts
Normal file
9
demos/src/checkbox/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/checkbox/app/app.module.ts
Normal file
19
demos/src/checkbox/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/checkbox/app/main.ts
Normal file
5
demos/src/checkbox/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/checkbox/pages/page-one/page-one.module.ts
Normal file
17
demos/src/checkbox/pages/page-one/page-one.module.ts
Normal 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 {}
|
22
demos/src/checkbox/pages/page-one/page-one.ts
Normal file
22
demos/src/checkbox/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
|
||||
data = {
|
||||
jon: true,
|
||||
daenerys: true,
|
||||
arya: false,
|
||||
tyroin: false,
|
||||
sansa: true,
|
||||
khal: false,
|
||||
cersei: true,
|
||||
stannis: true,
|
||||
petyr: false,
|
||||
hodor: true,
|
||||
catelyn: true,
|
||||
bronn: false
|
||||
};
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
delete(chip: Element) {
|
||||
chip.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
9
demos/src/chip/app/app.component.ts
Normal file
9
demos/src/chip/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/chip/app/app.module.ts
Normal file
19
demos/src/chip/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/chip/app/main.ts
Normal file
5
demos/src/chip/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/chip/pages/page-one/page-one.module.ts
Normal file
17
demos/src/chip/pages/page-one/page-one.module.ts
Normal 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 {}
|
10
demos/src/chip/pages/page-one/page-one.ts
Normal file
10
demos/src/chip/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
delete(chip: Element) {
|
||||
chip.remove();
|
||||
}
|
||||
}
|
39
demos/src/config/app/app.component.ts
Normal file
39
demos/src/config/app/app.component.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Config, Platform } from '../../../../src';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
config: any;
|
||||
root = PageOne;
|
||||
constructor(public _config: Config, public platform: Platform) {
|
||||
|
||||
if (window.localStorage.getItem('configDemo') !== null) {
|
||||
this.config = JSON.parse(window.localStorage.getItem('configDemo'));
|
||||
} else if (platform.is('ios')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
} else if (platform.is('windows')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'top'
|
||||
};
|
||||
} else {
|
||||
this.config = {
|
||||
'backButtonIcon': 'md-arrow-back',
|
||||
'iconMode': 'md',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
}
|
||||
|
||||
this._config.set('tabsPlacement', this.config.tabsPlacement);
|
||||
this._config.set('iconMode', this.config.iconMode);
|
||||
this._config.set('backButtonIcon', this.config.backButtonIcon);
|
||||
}
|
||||
}
|
@ -1,5 +1,26 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { Config, IonicApp, IonicModule, Platform, NavController } from '../../ionic-angular';
|
||||
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';
|
||||
import { PageThreeModule } from '../pages/page-three/page-three.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent, CONFIG_DEMO),
|
||||
PageOneModule,
|
||||
PageTwoModule,
|
||||
PageThreeModule
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
if (!window.localStorage) {
|
||||
Object.defineProperty(window, 'localStorage', new (function () {
|
||||
@ -19,7 +40,7 @@ if (!window.localStorage) {
|
||||
Object.defineProperty(oStorage, 'setItem', {
|
||||
value: function (sKey: string, sValue: string) {
|
||||
if (!sKey) { return; }
|
||||
document.cookie = encodeURI(sKey) + '=' + encodeURI(sValue) + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/';
|
||||
document.cookie = encodeURI(sKey) + '=' + encodeURI(sValue) + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=';
|
||||
},
|
||||
writable: false,
|
||||
configurable: false,
|
||||
@ -33,7 +54,7 @@ if (!window.localStorage) {
|
||||
Object.defineProperty(oStorage, 'removeItem', {
|
||||
value: function (sKey: string) {
|
||||
if (!sKey) { return; }
|
||||
document.cookie = encodeURI(sKey) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
|
||||
document.cookie = encodeURI(sKey) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=';
|
||||
},
|
||||
writable: false,
|
||||
configurable: false,
|
||||
@ -70,102 +91,3 @@ var CONFIG_DEMO: any = null;
|
||||
if (window.localStorage.getItem('configDemo')) {
|
||||
CONFIG_DEMO = JSON.parse(window.localStorage.getItem('configDemo'));
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'tabs.html'
|
||||
})
|
||||
export class TabPage {
|
||||
tabOne = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
config: any;
|
||||
initialConfig: any;
|
||||
constructor(_config: Config, public navCtrl: NavController) {
|
||||
this.config = _config.settings();
|
||||
this.initialConfig = this.config;
|
||||
}
|
||||
|
||||
|
||||
load() {
|
||||
window.localStorage.setItem('configDemo', JSON.stringify(this.config));
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
push() {
|
||||
this.navCtrl.push(PushPage);
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: 'push-page.html'
|
||||
})
|
||||
export class PushPage {
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
pop() {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root" #content></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
config: any;
|
||||
root = TabPage;
|
||||
constructor(public _config: Config, public platform: Platform) {
|
||||
|
||||
if (window.localStorage.getItem('configDemo') !== null) {
|
||||
this.config = JSON.parse(window.localStorage.getItem('configDemo'));
|
||||
} else if (platform.is('ios')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
} else if (platform.is('windows')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'top'
|
||||
};
|
||||
} else {
|
||||
this.config = {
|
||||
'backButtonIcon': 'md-arrow-back',
|
||||
'iconMode': 'md',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
}
|
||||
|
||||
this._config.set('tabsPlacement', this.config.tabsPlacement);
|
||||
this._config.set('iconMode', this.config.iconMode);
|
||||
this._config.set('backButtonIcon', this.config.backButtonIcon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage,
|
||||
PushPage,
|
||||
TabPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp, CONFIG_DEMO)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage,
|
||||
PushPage,
|
||||
TabPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/config/app/main.ts
Normal file
5
demos/src/config/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/config/pages/page-one/page-one.module.ts
Normal file
17
demos/src/config/pages/page-one/page-one.module.ts
Normal 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 {}
|
9
demos/src/config/pages/page-one/page-one.ts
Normal file
9
demos/src/config/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageTwo } from '../page-two/page-two';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
tabOne = PageTwo;
|
||||
}
|
17
demos/src/config/pages/page-three/page-three.module.ts
Normal file
17
demos/src/config/pages/page-three/page-three.module.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DeepLinkModule } from '../../../../../src';
|
||||
|
||||
import { PageThree } from './page-three';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageThree,
|
||||
],
|
||||
imports: [
|
||||
DeepLinkModule.forChild(PageThree),
|
||||
],
|
||||
entryComponents: [
|
||||
PageThree,
|
||||
]
|
||||
})
|
||||
export class PageThreeModule {}
|
13
demos/src/config/pages/page-three/page-three.ts
Normal file
13
demos/src/config/pages/page-three/page-three.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-three.html'
|
||||
})
|
||||
export class PageThree {
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
pop() {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
@ -52,6 +52,7 @@
|
||||
<pre margin>
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(MyApp, {
|
||||
backButtonIcon: "{{initialConfig?.backButtonIcon}}"
|
||||
iconMode: "{{initialConfig?.iconMode}}"
|
17
demos/src/config/pages/page-two/page-two.module.ts
Normal file
17
demos/src/config/pages/page-two/page-two.module.ts
Normal 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 {}
|
24
demos/src/config/pages/page-two/page-two.ts
Normal file
24
demos/src/config/pages/page-two/page-two.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Config, NavController } from '../../../../../src';
|
||||
import { PageThree } from '../page-three/page-three';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-two.html'
|
||||
})
|
||||
export class PageTwo {
|
||||
config: any;
|
||||
initialConfig: any;
|
||||
constructor(_config: Config, public navCtrl: NavController) {
|
||||
this.config = _config.settings();
|
||||
this.initialConfig = this.config;
|
||||
}
|
||||
|
||||
load() {
|
||||
window.localStorage.setItem('configDemo', JSON.stringify(this.config));
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
push() {
|
||||
this.navCtrl.push(PageThree);
|
||||
}
|
||||
}
|
11
demos/src/config/pages/push-page.html
Normal file
11
demos/src/config/pages/push-page.html
Normal file
@ -0,0 +1,11 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Page</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div padding>
|
||||
<button ion-button block (click)="pop()">Go Back to Config</button>
|
||||
</div>
|
||||
</ion-content>
|
9
demos/src/datetime/app/app.component.ts
Normal file
9
demos/src/datetime/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/datetime/app/app.module.ts
Normal file
19
demos/src/datetime/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/datetime/app/main.ts
Normal file
5
demos/src/datetime/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/datetime/pages/page-one/page-one.module.ts
Normal file
17
demos/src/datetime/pages/page-one/page-one.module.ts
Normal 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 {}
|
@ -1,11 +1,9 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
export class PageOne {
|
||||
wwwReleased = '1991';
|
||||
netscapeReleased = '1994-12-15T13:47:20.789';
|
||||
operaReleased = '1995-04-15';
|
||||
@ -40,7 +38,7 @@ export class ApiDemoPage {
|
||||
}
|
||||
}
|
||||
|
||||
calculateTime(offset) {
|
||||
calculateTime(offset: any) {
|
||||
// create Date object for current location
|
||||
let d = new Date();
|
||||
|
||||
@ -52,37 +50,13 @@ export class ApiDemoPage {
|
||||
}
|
||||
|
||||
// Determine if the client uses DST
|
||||
stdTimezoneOffset(today) {
|
||||
stdTimezoneOffset(today: any) {
|
||||
let jan = new Date(today.getFullYear(), 0, 1);
|
||||
let jul = new Date(today.getFullYear(), 6, 1);
|
||||
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
|
||||
}
|
||||
|
||||
dst(today) {
|
||||
dst(today: any) {
|
||||
return today.getTimezoneOffset() < this.stdTimezoneOffset(today);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
@ -1,89 +0,0 @@
|
||||
import { Component, NgModule, ViewChild } from '@angular/core';
|
||||
import { Events, IonicApp, IonicModule, Nav } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'login.html'
|
||||
})
|
||||
export class Login {
|
||||
user = {
|
||||
name: 'Administrator',
|
||||
username: 'admin'
|
||||
};
|
||||
|
||||
constructor(private events: Events) {}
|
||||
|
||||
login() {
|
||||
this.events.publish('user:login');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: 'logout.html'
|
||||
})
|
||||
export class Logout {
|
||||
constructor(private events: Events) {}
|
||||
|
||||
logout() {
|
||||
this.events.publish('user:logout');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'app.html'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
@ViewChild(Nav) nav: Nav;
|
||||
|
||||
root = Login;
|
||||
loggedIn = false;
|
||||
|
||||
loggedInPages = [
|
||||
{ title: 'Logout', component: Logout }
|
||||
];
|
||||
|
||||
loggedOutPages = [
|
||||
{ title: 'Login', component: Login }
|
||||
];
|
||||
|
||||
constructor(private events: Events) {
|
||||
this.listenToLoginEvents();
|
||||
}
|
||||
|
||||
openPage(menu, page) {
|
||||
// find the nav component and set what the root page should be
|
||||
// reset the nav to remove previous pages and only have this page
|
||||
// we wouldn't want the back button to show in this scenario
|
||||
this.nav.setRoot(page.component);
|
||||
}
|
||||
|
||||
listenToLoginEvents() {
|
||||
this.events.subscribe('user:login', () => {
|
||||
this.loggedIn = true;
|
||||
});
|
||||
|
||||
this.events.subscribe('user:logout', () => {
|
||||
this.loggedIn = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
Login,
|
||||
Logout
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
Login,
|
||||
Logout
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
45
demos/src/events/app/app.component.ts
Normal file
45
demos/src/events/app/app.component.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { Events, Nav } from '../../../../src';
|
||||
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
import { PageTwo } from '../pages/page-two/page-two';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'app.component.html'
|
||||
})
|
||||
export class AppComponent {
|
||||
|
||||
@ViewChild(Nav) nav: Nav;
|
||||
|
||||
root = PageOne;
|
||||
loggedIn = false;
|
||||
|
||||
loggedInPages = [
|
||||
{ title: 'Logout', component: PageTwo }
|
||||
];
|
||||
|
||||
loggedOutPages = [
|
||||
{ title: 'Login', component: PageOne }
|
||||
];
|
||||
|
||||
constructor(private events: Events) {
|
||||
this.listenToLoginEvents();
|
||||
}
|
||||
|
||||
openPage(menu: any, page: any) {
|
||||
// find the nav component and set what the root page should be
|
||||
// reset the nav to remove previous pages and only have this page
|
||||
// we wouldn't want the back button to show in this scenario
|
||||
this.nav.setRoot(page.component);
|
||||
}
|
||||
|
||||
listenToLoginEvents() {
|
||||
this.events.subscribe('user:login', () => {
|
||||
this.loggedIn = true;
|
||||
});
|
||||
|
||||
this.events.subscribe('user:logout', () => {
|
||||
this.loggedIn = false;
|
||||
});
|
||||
}
|
||||
}
|
21
demos/src/events/app/app.module.ts
Normal file
21
demos/src/events/app/app.module.ts
Normal 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 {}
|
5
demos/src/events/app/main.ts
Normal file
5
demos/src/events/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/events/pages/page-one/page-one.module.ts
Normal file
17
demos/src/events/pages/page-one/page-one.module.ts
Normal 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 {}
|
18
demos/src/events/pages/page-one/page-one.ts
Normal file
18
demos/src/events/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Events } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
user = {
|
||||
name: 'Administrator',
|
||||
username: 'admin'
|
||||
};
|
||||
|
||||
constructor(private events: Events) {}
|
||||
|
||||
login() {
|
||||
this.events.publish('user:login');
|
||||
}
|
||||
}
|
17
demos/src/events/pages/page-two/page-two.module.ts
Normal file
17
demos/src/events/pages/page-two/page-two.module.ts
Normal 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 {}
|
13
demos/src/events/pages/page-two/page-two.ts
Normal file
13
demos/src/events/pages/page-two/page-two.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Events } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-two.html'
|
||||
})
|
||||
export class PageTwo {
|
||||
constructor(private events: Events) {}
|
||||
|
||||
logout() {
|
||||
this.events.publish('user:logout');
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { FabContainer, IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
array: number[] = [];
|
||||
|
||||
add() {
|
||||
this.array.push(1);
|
||||
}
|
||||
|
||||
clickMainFAB() {
|
||||
console.log('Clicked open social menu');
|
||||
}
|
||||
|
||||
openSocial(network: string, fab: FabContainer) {
|
||||
console.log('Share in ' + network);
|
||||
fab.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
|
9
demos/src/fab/app/app.component.ts
Normal file
9
demos/src/fab/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/fab/app/app.module.ts
Normal file
19
demos/src/fab/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/fab/app/main.ts
Normal file
5
demos/src/fab/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/fab/pages/page-one/page-one.module.ts
Normal file
17
demos/src/fab/pages/page-one/page-one.module.ts
Normal 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 {}
|
22
demos/src/fab/pages/page-one/page-one.ts
Normal file
22
demos/src/fab/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FabContainer } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
array: number[] = [];
|
||||
|
||||
add() {
|
||||
this.array.push(1);
|
||||
}
|
||||
|
||||
clickMainFAB() {
|
||||
console.log('Clicked open social menu');
|
||||
}
|
||||
|
||||
openSocial(network: string, fab: FabContainer) {
|
||||
console.log('Share in ' + network);
|
||||
fab.close();
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
9
demos/src/hide-when/app/app.component.ts
Normal file
9
demos/src/hide-when/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/hide-when/app/app.module.ts
Normal file
19
demos/src/hide-when/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/hide-when/app/main.ts
Normal file
5
demos/src/hide-when/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/hide-when/pages/page-one/page-one.module.ts
Normal file
17
demos/src/hide-when/pages/page-one/page-one.module.ts
Normal 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 {}
|
6
demos/src/hide-when/pages/page-one/page-one.ts
Normal file
6
demos/src/hide-when/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {}
|
@ -1,32 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
9
demos/src/icon/app/app.component.ts
Normal file
9
demos/src/icon/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/icon/app/app.module.ts
Normal file
19
demos/src/icon/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/icon/app/main.ts
Normal file
5
demos/src/icon/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/icon/pages/page-one/page-one.module.ts
Normal file
17
demos/src/icon/pages/page-one/page-one.module.ts
Normal 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 {}
|
6
demos/src/icon/pages/page-one/page-one.ts
Normal file
6
demos/src/icon/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {}
|
@ -1,117 +0,0 @@
|
||||
import { Component, Injectable, NgModule } from '@angular/core';
|
||||
import { InfiniteScroll, IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
/**
|
||||
* Mock Data Access Object
|
||||
**/
|
||||
@Injectable()
|
||||
export class MockProvider {
|
||||
|
||||
getData(): any[] {
|
||||
// return mock data synchronously
|
||||
let data = [];
|
||||
for (var i = 0; i < 20; i++) {
|
||||
data.push( this._getRandomData() );
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
getAsyncData(): Promise<any[]> {
|
||||
// async receive mock data
|
||||
return new Promise(resolve => {
|
||||
|
||||
setTimeout(() => {
|
||||
resolve(this.getData());
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private _getRandomData() {
|
||||
let i = Math.floor( Math.random() * this._data.length );
|
||||
return this._data[i];
|
||||
}
|
||||
|
||||
private _data = [
|
||||
'Fast Times at Ridgemont High',
|
||||
'Peggy Sue Got Married',
|
||||
'Raising Arizona',
|
||||
'Moonstruck',
|
||||
'Fire Birds',
|
||||
'Honeymoon in Vegas',
|
||||
'Amos & Andrew',
|
||||
'It Could Happen to You',
|
||||
'Trapped in Paradise',
|
||||
'Leaving Las Vegas',
|
||||
'The Rock',
|
||||
'Con Air',
|
||||
'Face/Off',
|
||||
'City of Angels',
|
||||
'Gone in Sixty Seconds',
|
||||
'The Family Man',
|
||||
'Windtalkers',
|
||||
'Matchstick Men',
|
||||
'National Treasure',
|
||||
'Ghost Rider',
|
||||
'Grindhouse',
|
||||
'Next',
|
||||
'Kick-Ass',
|
||||
'Drive Angry',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
items: string[];
|
||||
|
||||
constructor(private mockProvider: MockProvider) {
|
||||
this.items = mockProvider.getData();
|
||||
}
|
||||
|
||||
doInfinite(infiniteScroll: InfiniteScroll) {
|
||||
this.mockProvider.getAsyncData().then((newData) => {
|
||||
for (var i = 0; i < newData.length; i++) {
|
||||
this.items.push( newData[i] );
|
||||
}
|
||||
|
||||
infiniteScroll.complete();
|
||||
|
||||
if (this.items.length > 90) {
|
||||
infiniteScroll.enable(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
rootPage = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
providers: [
|
||||
MockProvider
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
9
demos/src/infinite-scroll/app/app.component.ts
Normal file
9
demos/src/infinite-scroll/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/infinite-scroll/app/app.module.ts
Normal file
19
demos/src/infinite-scroll/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/infinite-scroll/app/main.ts
Normal file
5
demos/src/infinite-scroll/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
21
demos/src/infinite-scroll/pages/page-one/page-one.module.ts
Normal file
21
demos/src/infinite-scroll/pages/page-one/page-one.module.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DeepLinkModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
import { MockProvider } from './provider';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
DeepLinkModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
],
|
||||
providers: [
|
||||
MockProvider
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
28
demos/src/infinite-scroll/pages/page-one/page-one.ts
Normal file
28
demos/src/infinite-scroll/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { MockProvider} from './provider';
|
||||
import { InfiniteScroll } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
items: string[];
|
||||
|
||||
constructor(private mockProvider: MockProvider) {
|
||||
this.items = mockProvider.getData();
|
||||
}
|
||||
|
||||
doInfinite(infiniteScroll: InfiniteScroll) {
|
||||
this.mockProvider.getAsyncData().then((newData) => {
|
||||
for (var i = 0; i < newData.length; i++) {
|
||||
this.items.push( newData[i] );
|
||||
}
|
||||
|
||||
infiniteScroll.complete();
|
||||
|
||||
if (this.items.length > 90) {
|
||||
infiniteScroll.enable(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
58
demos/src/infinite-scroll/pages/page-one/provider.ts
Normal file
58
demos/src/infinite-scroll/pages/page-one/provider.ts
Normal file
@ -0,0 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
export class MockProvider {
|
||||
|
||||
getData(): any[] {
|
||||
// return mock data synchronously
|
||||
let data: any[] = [];
|
||||
for (var i = 0; i < 20; i++) {
|
||||
data.push( this._getRandomData() );
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
getAsyncData(): Promise<any[]> {
|
||||
// async receive mock data
|
||||
return new Promise(resolve => {
|
||||
|
||||
setTimeout(() => {
|
||||
resolve(this.getData());
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private _getRandomData() {
|
||||
let i = Math.floor( Math.random() * this._data.length );
|
||||
return this._data[i];
|
||||
}
|
||||
|
||||
private _data = [
|
||||
'Fast Times at Ridgemont High',
|
||||
'Peggy Sue Got Married',
|
||||
'Raising Arizona',
|
||||
'Moonstruck',
|
||||
'Fire Birds',
|
||||
'Honeymoon in Vegas',
|
||||
'Amos & Andrew',
|
||||
'It Could Happen to You',
|
||||
'Trapped in Paradise',
|
||||
'Leaving Las Vegas',
|
||||
'The Rock',
|
||||
'Con Air',
|
||||
'Face/Off',
|
||||
'City of Angels',
|
||||
'Gone in Sixty Seconds',
|
||||
'The Family Man',
|
||||
'Windtalkers',
|
||||
'Matchstick Men',
|
||||
'National Treasure',
|
||||
'Ghost Rider',
|
||||
'Grindhouse',
|
||||
'Next',
|
||||
'Kick-Ass',
|
||||
'Drive Angry',
|
||||
];
|
||||
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
9
demos/src/input/app/app.component.ts
Normal file
9
demos/src/input/app/app.component.ts
Normal 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;
|
||||
}
|
19
demos/src/input/app/app.module.ts
Normal file
19
demos/src/input/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
demos/src/input/app/main.ts
Normal file
5
demos/src/input/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
17
demos/src/input/pages/page-one/page-one.module.ts
Normal file
17
demos/src/input/pages/page-one/page-one.module.ts
Normal 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 {}
|
6
demos/src/input/pages/page-one/page-one.ts
Normal file
6
demos/src/input/pages/page-one/page-one.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {}
|
9
demos/src/item-reorder/app/app.component.ts
Normal file
9
demos/src/item-reorder/app/app.component.ts
Normal 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;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user