chore(build): fix demo compile errors, tslint errors
fix demo compile errors, tslint errors
@ -1,31 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.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 {}
|
@ -1,24 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { ionicBootstrap } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class ApiDemoPage {
|
||||
delete(chip: Element) {
|
||||
chip.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
||||
}
|
||||
|
||||
ionicBootstrap(ApiDemoApp);
|
||||
|
@ -1,31 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.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 {}
|
@ -1,30 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.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 {}
|
@ -1,30 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.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 {}
|
@ -1,6 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { ActionSheetController, IonicModule, Platform } from 'ionic-angular';
|
||||
|
||||
import { ActionSheetController, IonicApp, IonicModule, Platform } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { AlertController, IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -26,7 +26,7 @@ export class ApiDemoPage {
|
||||
doConfirm() {
|
||||
let alert = this.alertCtrl.create({
|
||||
title: 'Use this lightsaber?',
|
||||
body: 'Do you agree to use this lightsaber to do good across the intergalactic galaxy?',
|
||||
message: 'Do you agree to use this lightsaber to do good across the intergalactic galaxy?',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Disagree',
|
||||
@ -49,7 +49,7 @@ export class ApiDemoPage {
|
||||
doPrompt() {
|
||||
let alert = this.alertCtrl.create({
|
||||
title: 'Login',
|
||||
body: "Enter a name for this new album you're so keen on adding",
|
||||
message: 'Enter a name for this new album you\'re so keen on adding',
|
||||
inputs: [
|
||||
{
|
||||
name: 'title',
|
||||
@ -211,7 +211,7 @@ export class ApiDemoPage {
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
template: `<ion-nav [root]="root"></ion-nav>`
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
@ -1,16 +1,15 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
demo = "Toolbar";
|
||||
favorites = "recent";
|
||||
apps = "free";
|
||||
delete(chip: Element) {
|
||||
chip.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
@ -4,38 +4,38 @@ import { IonicModule, IonicApp, Platform, NavController } from 'ionic-angular';
|
||||
|
||||
|
||||
if (!window.localStorage) {
|
||||
Object.defineProperty(window, "localStorage", new (function () {
|
||||
Object.defineProperty(window, 'localStorage', new (function () {
|
||||
var aKeys = [], oStorage = {};
|
||||
Object.defineProperty(oStorage, "getItem", {
|
||||
Object.defineProperty(oStorage, 'getItem', {
|
||||
value: function (sKey) { return sKey ? this[sKey] : null; },
|
||||
writable: false,
|
||||
configurable: false,
|
||||
enumerable: false
|
||||
});
|
||||
Object.defineProperty(oStorage, "key", {
|
||||
Object.defineProperty(oStorage, 'key', {
|
||||
value: function (nKeyId) { return aKeys[nKeyId]; },
|
||||
writable: false,
|
||||
configurable: false,
|
||||
enumerable: false
|
||||
});
|
||||
Object.defineProperty(oStorage, "setItem", {
|
||||
Object.defineProperty(oStorage, 'setItem', {
|
||||
value: function (sKey, sValue) {
|
||||
if(!sKey) { return; }
|
||||
document.cookie = escape(sKey) + "=" + escape(sValue) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/";
|
||||
if (!sKey) { return; }
|
||||
document.cookie = encodeURI(sKey) + '=' + encodeURI(sValue) + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/';
|
||||
},
|
||||
writable: false,
|
||||
configurable: false,
|
||||
enumerable: false
|
||||
});
|
||||
Object.defineProperty(oStorage, "length", {
|
||||
Object.defineProperty(oStorage, 'length', {
|
||||
get: function () { return aKeys.length; },
|
||||
configurable: false,
|
||||
enumerable: false
|
||||
});
|
||||
Object.defineProperty(oStorage, "removeItem", {
|
||||
Object.defineProperty(oStorage, 'removeItem', {
|
||||
value: function (sKey) {
|
||||
if(!sKey) { return; }
|
||||
document.cookie = escape(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
|
||||
if (!sKey) { return; }
|
||||
document.cookie = encodeURI(sKey) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
|
||||
},
|
||||
writable: false,
|
||||
configurable: false,
|
||||
@ -45,15 +45,18 @@ if (!window.localStorage) {
|
||||
var iThisIndx;
|
||||
for (var sKey in oStorage) {
|
||||
iThisIndx = aKeys.indexOf(sKey);
|
||||
if (iThisIndx === -1) { oStorage.setItem(sKey, oStorage[sKey]); }
|
||||
else { aKeys.splice(iThisIndx, 1); }
|
||||
if (iThisIndx === -1) {
|
||||
(oStorage as any).setItem(sKey, oStorage[sKey]);
|
||||
} else {
|
||||
aKeys.splice(iThisIndx, 1);
|
||||
}
|
||||
delete oStorage[sKey];
|
||||
}
|
||||
for (aKeys; aKeys.length > 0; aKeys.splice(0, 1)) { oStorage.removeItem(aKeys[0]); }
|
||||
for (aKeys; aKeys.length > 0; aKeys.splice(0, 1)) { (oStorage as any).removeItem(aKeys[0]); }
|
||||
for (var aCouple, iKey, nIdx = 0, aCouples = document.cookie.split(/\s*;\s*/); nIdx < aCouples.length; nIdx++) {
|
||||
aCouple = aCouples[nIdx].split(/\s*=\s*/);
|
||||
if (aCouple.length > 1) {
|
||||
oStorage[iKey = unescape(aCouple[0])] = unescape(aCouple[1]);
|
||||
oStorage[iKey = decodeURI(aCouple[0])] = decodeURI(aCouple[1]);
|
||||
aKeys.push(iKey);
|
||||
}
|
||||
}
|
||||
@ -95,7 +98,7 @@ export class ApiDemoPage {
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
} else if(platform.is('windows')) {
|
||||
} else if (platform.is('windows')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
@ -1,13 +1,13 @@
|
||||
import { Component, ViewChild, NgModule } from '@angular/core';
|
||||
import { Events, IonicModule, Nav } from 'ionic-angular';
|
||||
import { Events, IonicApp, IonicModule, Nav } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'login.html'
|
||||
})
|
||||
export class Login {
|
||||
user = {
|
||||
name: "Administrator",
|
||||
username: "admin"
|
||||
name: 'Administrator',
|
||||
username: 'admin'
|
||||
};
|
||||
|
||||
constructor(private events: Events) {}
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule, Injectable } from '@angular/core';
|
||||
import { IonicModule, InfiniteScroll } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, InfiniteScroll } from 'ionic-angular';
|
||||
|
||||
/**
|
||||
* Mock Data Access Object
|
||||
@ -7,7 +7,7 @@ import { IonicModule, InfiniteScroll } from 'ionic-angular';
|
||||
@Injectable()
|
||||
export class MockProvider {
|
||||
|
||||
getData() {
|
||||
getData(): any[] {
|
||||
// return mock data synchronously
|
||||
let data = [];
|
||||
for (var i = 0; i < 20; i++) {
|
||||
@ -16,7 +16,7 @@ export class MockProvider {
|
||||
return data;
|
||||
}
|
||||
|
||||
getAsyncData() {
|
||||
getAsyncData(): Promise<any[]> {
|
||||
// async receive mock data
|
||||
return new Promise(resolve => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule, ViewEncapsulation } from '@angular/core';
|
||||
import { IonicModule, ItemSliding, NavController, Toast, reorderArray } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, NavController, reorderArray } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html',
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule, ViewEncapsulation } from '@angular/core';
|
||||
import { IonicModule, ItemSliding, ToastController } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, ItemSliding, ToastController } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -73,14 +73,14 @@ export class ApiDemoPage {
|
||||
}
|
||||
|
||||
expandAction(item: ItemSliding, action: string, text: string) {
|
||||
item.setCssClass(action, true);
|
||||
// TODO item.setCssClass(action, true);
|
||||
|
||||
setTimeout(() => {
|
||||
const toast = this.toastCtrl.create({
|
||||
message: text
|
||||
});
|
||||
toast.present();
|
||||
item.setCssClass(action, false);
|
||||
// TODO item.setCssClass(action, false);
|
||||
item.close();
|
||||
|
||||
setTimeout(() => toast.dismiss(), 2000);
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
31
demos/src/item/AppModule.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.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 {}
|
@ -1,6 +1,6 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
31
demos/src/list/AppModule.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.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 {}
|
@ -1,6 +1,6 @@
|
||||
import { Component, NgModule, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import { IonicModule, LoadingController, NavController } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, LoadingController, NavController } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
@ -1,7 +1,5 @@
|
||||
import { Component, NgModule, Injectable, Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
import { Config, IonicModule, LocalStorage, Platform, Storage } from 'ionic-angular';
|
||||
|
||||
import { IonicApp, IonicModule, LocalStorage, Storage } from 'ionic-angular';
|
||||
|
||||
@Pipe({
|
||||
name: 'cleanLocalData'
|
||||
@ -12,7 +10,7 @@ export class CleanLocalDataPipe implements PipeTransform {
|
||||
output: any;
|
||||
data: any;
|
||||
|
||||
transform(obj:any) : any {
|
||||
transform(obj: any): any {
|
||||
this.validKeys = ['username', 'name', 'email', 'address'];
|
||||
this.output = {};
|
||||
this.data = JSON.parse(obj);
|
||||
@ -27,8 +25,7 @@ export class CleanLocalDataPipe implements PipeTransform {
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html',
|
||||
pipes: [CleanLocalDataPipe]
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
local: Storage;
|
||||
@ -55,11 +52,12 @@ export class ApiDemoPage {
|
||||
let added = false;
|
||||
|
||||
for (let i = 0; i < this.addedKeys.length; i++) {
|
||||
if (this.addedKeys[i] == this.myItem.key) added = true;
|
||||
if (this.addedKeys[i] === this.myItem.key) {
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (added == false) {
|
||||
console.log("Adding key", this.myItem.key);
|
||||
if (added === false) {
|
||||
this.addedKeys.push(this.myItem.key);
|
||||
this.delKey = this.myItem.key;
|
||||
this.local.set(this.myItem.key, this.myItem.value );
|
||||
@ -81,8 +79,7 @@ export class ApiDemoPage {
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>',
|
||||
pipes: [CleanLocalDataPipe]
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
root = ApiDemoPage;
|
@ -1,6 +1,6 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicModule, MenuController } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, MenuController } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
@ -1,6 +1,6 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { Animation, IonicModule, ModalController, NavController, NavParams, ViewController } from 'ionic-angular';
|
||||
import { Animation, IonicApp, IonicModule, ModalController, NavParams, ViewController } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -29,7 +29,7 @@ export class ModalFirstPage {
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: "modal-content.html"
|
||||
templateUrl: 'modal-content.html'
|
||||
})
|
||||
export class ModalContentPage {
|
||||
myParam: string;
|
||||
@ -58,15 +58,14 @@ export class ApiDemoApp {
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ModalFirstPage,
|
||||
ModalContentPage,
|
||||
ApiDemoPage
|
||||
ModalContentPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage
|
||||
ModalFirstPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
@ -1,6 +1,6 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicModule, NavController, NavParams } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -18,7 +18,7 @@ export class ApiDemoPage {
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: "page.html"
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class PushPage {
|
||||
myParam: string;
|
||||
@ -39,7 +39,7 @@ export class ApiDemoApp {
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
ApiDemoPage,
|
||||
PushPage
|
||||
],
|
||||
imports: [
|
@ -1,14 +1,14 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
// Use the toolbar demo but pass in the demo name to change the title
|
||||
@Component({
|
||||
templateUrl: '../toolbar/main.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
demo = "Navbar";
|
||||
favorites = "recent";
|
||||
apps = "free";
|
||||
demo = 'Navbar';
|
||||
favorites = 'recent';
|
||||
apps = 'free';
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { Config, IonicModule, NavController, NavParams, Platform } from 'ionic-angular';
|
||||
|
||||
var PAGE_NUM = 2;
|
||||
import { IonicApp, IonicModule, NavController } from 'ionic-angular';
|
||||
|
||||
let pageNum = 2;
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
@ -16,21 +15,21 @@ export class ApiDemoPage {
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: "page.html"
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class PushPage {
|
||||
pageNum = PAGE_NUM;
|
||||
pageNum = pageNum;
|
||||
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
push() {
|
||||
PAGE_NUM++;
|
||||
pageNum++;
|
||||
this.navCtrl.push(PushPage);
|
||||
}
|
||||
|
||||
pop() {
|
||||
if (PAGE_NUM > 2) {
|
||||
PAGE_NUM--;
|
||||
if (pageNum > 2) {
|
||||
pageNum--;
|
||||
}
|
||||
this.navCtrl.pop();
|
||||
}
|
11
demos/src/package.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "ionic-demos",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": "demos of ionic framework",
|
||||
"author": "Ionic Team <hi@ionic.io> (http://ionic.io)",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ionic-angular": "nightly"
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule, Platform } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, Platform } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -17,7 +17,6 @@ export class ApiDemoPage {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule, ElementRef, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { IonicModule, NavParams, PopoverController } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, NavParams, PopoverController } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -102,8 +102,8 @@ export class PopoverRadioPage {
|
||||
|
||||
if (!background) return 'white';
|
||||
|
||||
for(var key in this.colors) {
|
||||
if (this.colors[key].bg == background) {
|
||||
for (var key in this.colors) {
|
||||
if (this.colors[key].bg === background) {
|
||||
colorName = key;
|
||||
}
|
||||
}
|
||||
@ -113,7 +113,7 @@ export class PopoverRadioPage {
|
||||
|
||||
setFontFamily() {
|
||||
if (this.textEle.style.fontFamily) {
|
||||
this.fontFamily = this.textEle.style.fontFamily.replace(/'/g, "");
|
||||
this.fontFamily = this.textEle.style.fontFamily.replace(/'/g, '');
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -9,7 +9,6 @@ export class ApiDemoPage {
|
||||
isDisabled = true;
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
@ -11,7 +11,7 @@ export class ApiDemoPage {
|
||||
structure: any = {lower: 33, upper: 60};
|
||||
|
||||
onChange(ev) {
|
||||
console.log("Changed", ev);
|
||||
console.log('Changed', ev);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, NgModule, Injectable } from '@angular/core';
|
||||
|
||||
import { IonicModule, Refresher } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule, Refresher } from 'ionic-angular';
|
||||
|
||||
|
||||
/**
|
||||
@ -9,7 +9,7 @@ import { IonicModule, Refresher } from 'ionic-angular';
|
||||
@Injectable()
|
||||
export class MockProvider {
|
||||
|
||||
getData() {
|
||||
getData(): any[] {
|
||||
// return mock data synchronously
|
||||
let data = [];
|
||||
for (var i = 0; i < 3; i++) {
|
||||
@ -18,7 +18,7 @@ export class MockProvider {
|
||||
return data;
|
||||
}
|
||||
|
||||
getAsyncData() {
|
||||
getAsyncData(): Promise<any[]> {
|
||||
// async receive mock data
|
||||
return new Promise(resolve => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
Before Width: | Height: | Size: 642 KiB After Width: | Height: | Size: 642 KiB |
@ -1,6 +1,6 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
@ -1,18 +1,18 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
appType = "Paid";
|
||||
safari = "Shared Links";
|
||||
weather = "sunny";
|
||||
appType = 'Paid';
|
||||
safari = 'Shared Links';
|
||||
weather = 'sunny';
|
||||
|
||||
apps = {
|
||||
"Paid": [
|
||||
'Paid': [
|
||||
{
|
||||
name: 'Monopoly',
|
||||
price: '$0.99'
|
||||
@ -22,7 +22,7 @@ export class ApiDemoPage {
|
||||
price: '$2.99'
|
||||
}
|
||||
],
|
||||
"Free": [
|
||||
'Free': [
|
||||
{
|
||||
name: 'Snapchat',
|
||||
price: 'GET'
|
||||
@ -32,7 +32,7 @@ export class ApiDemoPage {
|
||||
price: 'OPEN'
|
||||
}
|
||||
],
|
||||
"Top": [
|
||||
'Top': [
|
||||
{
|
||||
name: 'Spotify',
|
||||
price: 'OPEN'
|
||||
@ -45,7 +45,7 @@ export class ApiDemoPage {
|
||||
};
|
||||
|
||||
items = {
|
||||
"Bookmarks": [
|
||||
'Bookmarks': [
|
||||
{
|
||||
name: 'Favorites',
|
||||
icon: 'ios-star-outline'
|
||||
@ -55,7 +55,7 @@ export class ApiDemoPage {
|
||||
icon: 'ios-clock-outline'
|
||||
}
|
||||
],
|
||||
"Reading List": [
|
||||
'Reading List': [
|
||||
{
|
||||
name: 'Terms of Service',
|
||||
icon: 'create'
|
||||
@ -65,7 +65,7 @@ export class ApiDemoPage {
|
||||
icon: 'book'
|
||||
}
|
||||
],
|
||||
"Shared Links": [
|
||||
'Shared Links': [
|
||||
{
|
||||
name: 'Ionic Framework',
|
||||
icon: 'ionic'
|
||||
@ -107,4 +107,5 @@ export class ApiDemoApp {
|
||||
ApiDemoPage
|
||||
]
|
||||
})
|
||||
export class AppModule {});
|
||||
export class AppModule {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicModule } from 'ionic-angular';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
30
demos/src/show-when/AppModule.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.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 {}
|