chore(demos): move app tests to demos
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
33
demos/native/index.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import {Component} from 'angular2/angular2';
|
||||||
|
import {Control, ControlGroup} from 'angular2/forms';
|
||||||
|
|
||||||
|
import {App, Http} from 'ionic/ionic';
|
||||||
|
|
||||||
|
import {Camera, Geolocation, Vibration, Battery, Device} from 'ionic/ionic';
|
||||||
|
|
||||||
|
import {CameraPage} from 'pages/camera';
|
||||||
|
import {BatteryPage} from 'pages/battery';
|
||||||
|
import {ContactsPage} from 'pages/contacts';
|
||||||
|
import {DevicePage} from 'pages/device';
|
||||||
|
import {DeviceMotionPage} from 'pages/device-motion';
|
||||||
|
import {GeolocationPage} from 'pages/geolocation';
|
||||||
|
import {VibrationPage} from 'pages/vibration';
|
||||||
|
|
||||||
|
@App({
|
||||||
|
templateUrl: 'main.html'
|
||||||
|
})
|
||||||
|
class IonicApp {
|
||||||
|
constructor() {
|
||||||
|
this.firstPage = CameraPage;
|
||||||
|
console.log('First page', CameraPage);
|
||||||
|
this.plugins = [
|
||||||
|
{title: 'Camera', page: CameraPage},
|
||||||
|
{title: 'Device', page: DevicePage},
|
||||||
|
{title: 'Device Motion', page: DeviceMotionPage},
|
||||||
|
{title: 'Geolocation', page: GeolocationPage},
|
||||||
|
{title: 'Contacts', page: ContactsPage},
|
||||||
|
{title: 'Battery', page: BatteryPage},
|
||||||
|
{title: 'Vibration', page: VibrationPage},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
12
demos/native/main.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<ion-aside #aside [content]="content" id="mainMenu">
|
||||||
|
<ion-toolbar><ion-title>Plugins</ion-title></ion-toolbar>
|
||||||
|
<ion-content>
|
||||||
|
<ion-list>
|
||||||
|
<ion-item *ng-for="#p of plugins" (^click)="openPage(aside, p)">
|
||||||
|
<span>{{p.title}}</span>
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
</ion-content>
|
||||||
|
</ion-aside>
|
||||||
|
|
||||||
|
<ion-nav #content swipe-back-enabled="false" [root]="firstPage"></ion-nav>
|
18
demos/native/pages/device-motion.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
|
@IonicView({
|
||||||
|
template: `
|
||||||
|
<ion-navbar *navbar>
|
||||||
|
<button aside-toggle>
|
||||||
|
<icon menu></icon>
|
||||||
|
</button>
|
||||||
|
<ion-title>Device Motion</ion-title>
|
||||||
|
</ion-navbar>
|
||||||
|
<ion-content class="padding">
|
||||||
|
</ion-content>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class DeviceMotionPage {
|
||||||
|
|
||||||
|
}
|
26
demos/native/pages/device.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
|
@IonicView({
|
||||||
|
template: `
|
||||||
|
<ion-navbar *navbar>
|
||||||
|
<button aside-toggle>
|
||||||
|
<icon menu></icon>
|
||||||
|
</button>
|
||||||
|
<ion-title>Vibration</ion-title>
|
||||||
|
</ion-navbar>
|
||||||
|
<ion-content class="padding">
|
||||||
|
<h2>Device</h2>
|
||||||
|
<button primary outline (click)="doDevice()">Get Device</button>
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class DevicePage {
|
||||||
|
|
||||||
|
doDevice() {
|
||||||
|
let device = Device.getDevice();
|
||||||
|
console.log('Got device', device);
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 519 KiB After Width: | Height: | Size: 519 KiB |
22
demos/sink/main.html
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<ion-aside #aside [content]="content" id="mainMenu">
|
||||||
|
<ion-toolbar><ion-title>Ionic 2.0</ion-title></ion-toolbar>
|
||||||
|
<ion-content>
|
||||||
|
<ion-list>
|
||||||
|
<ion-item *ng-for="#c of components" (^click)="openPage(aside, c)">
|
||||||
|
<span>{{c.title}}</span>
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
</ion-content>
|
||||||
|
</ion-aside>
|
||||||
|
|
||||||
|
<ion-nav #content swipe-back-enabled="false"></ion-nav>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
my-modal {
|
||||||
|
display: block;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |