mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge branch 'master' into css-refactor
# Conflicts: # ionic/components/action-sheet/action-sheet.ts
This commit is contained in:
@@ -122,7 +122,17 @@ export class ActionSheet {
|
||||
* public API, and most often you will only use ActionSheet.open()
|
||||
*
|
||||
* @param {Object} [opts={}] An object containing optional settings.
|
||||
* @param {String} [opts.pageType='action-sheet'] The page type that determines how the page renders and animates.
|
||||
* - `[Object]` `buttons` Which buttons to show. Each button is an object with a `text` field.
|
||||
* - `{string}` `titleText` The title to show on the action sheet.
|
||||
* - `{string=}` `cancelText` the text for a 'cancel' button on the action sheet.
|
||||
* - `{string=}` `destructiveText` The text for a 'danger' on the action sheet.
|
||||
* - `{function=}` `cancel` Called if the cancel button is pressed, the backdrop is tapped or
|
||||
* the hardware back button is pressed.
|
||||
* - `{function=}` `buttonClicked` Called when one of the non-destructive buttons is clicked,
|
||||
* with the index of the button that was clicked and the button object. Return true to close
|
||||
* the action sheet, or false to keep it opened.
|
||||
* - `{function=}` `destructiveButtonClicked` Called when the destructive button is clicked.
|
||||
* Return true to close the action sheet, or false to keep it opened.
|
||||
* @param {String} [opts.enterAnimation='action-sheet-slide-in'] The class used to animate an actionSheet that is entering.
|
||||
* @param {String} [opts.leaveAnimation='action-sheet-slide-out'] The class used to animate an actionSheet that is leaving.
|
||||
* @return {Promise} Promise that resolves when the action sheet is open.
|
||||
|
||||
42
ionic/components/app/test/storage/index.ts
Normal file
42
ionic/components/app/test/storage/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import {Component, Control, ControlGroup} from 'angular2/angular2';
|
||||
|
||||
import {App, Storage, LocalStorage, SqlStorage} from 'ionic/ionic';
|
||||
|
||||
@App({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class IonicApp {
|
||||
constructor() {
|
||||
this.local = new Storage(LocalStorage);
|
||||
this.sql = new Storage(SqlStorage);
|
||||
}
|
||||
getLocal() {
|
||||
this.local.get('name').then(value => {
|
||||
alert('Your name is: ' + value);
|
||||
});
|
||||
}
|
||||
setLocal() {
|
||||
let name = prompt('Your name?');
|
||||
|
||||
this.local.set('name', name);
|
||||
}
|
||||
removeLocal() {
|
||||
this.local.remove('name');
|
||||
}
|
||||
|
||||
getSql() {
|
||||
this.sql.get('name').then(value => {
|
||||
alert('Your name is: ' + value);
|
||||
}, (errResult) => {
|
||||
console.error('Unable to get item from SQL db:', errResult);
|
||||
});
|
||||
}
|
||||
setSql() {
|
||||
let name = prompt('Your name?');
|
||||
|
||||
this.sql.set('name', name);
|
||||
}
|
||||
removeSql() {
|
||||
this.sql.remove('name');
|
||||
}
|
||||
}
|
||||
11
ionic/components/app/test/storage/main.html
Normal file
11
ionic/components/app/test/storage/main.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<ion-content padding>
|
||||
<h2>Local Storage</h2>
|
||||
<button primary (click)="getLocal()">Get</button>
|
||||
<button primary (click)="setLocal()">Set</button>
|
||||
<button primary (click)="removeLocal()">Remove</button>
|
||||
|
||||
<h2>SQL Storage</h2>
|
||||
<button primary (click)="getSql()">Get</button>
|
||||
<button primary (click)="setSql()">Set</button>
|
||||
<button primary (click)="removeSql()">Remove</button>
|
||||
</ion-content>
|
||||
@@ -44,6 +44,7 @@ ion-segment {
|
||||
ion-segment-button[button][outline].activated,
|
||||
ion-segment-button[button][outline].segment-activated {
|
||||
background-color: transparent;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user