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