mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
merge conflicts
This commit is contained in:
@ -106,6 +106,8 @@ class ActionSheetCmp {
|
|||||||
*
|
*
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* @see {@link /docs/v2/components#action-sheets ActionSheet Component Docs}
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ActionSheet {
|
export class ActionSheet {
|
||||||
|
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>
|
@ -26,6 +26,8 @@ import {Config} from '../../config/config';
|
|||||||
* @property [fab-bottom] - position a fab button towards the bottom
|
* @property [fab-bottom] - position a fab button towards the bottom
|
||||||
* @description
|
* @description
|
||||||
* Buttons are simple components in Ionic, can consist of text, an icon, or both, and can be enhanced with a wide range of attributes.
|
* Buttons are simple components in Ionic, can consist of text, an icon, or both, and can be enhanced with a wide range of attributes.
|
||||||
|
* @see {@link /docs/v2/components#buttons Button Component Docs}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'button,[button]'
|
selector: 'button,[button]'
|
||||||
|
@ -17,6 +17,7 @@ import {Form} from '../../util/form';
|
|||||||
* HTML5
|
* HTML5
|
||||||
* </ion-checkbox>
|
* </ion-checkbox>
|
||||||
* ```
|
* ```
|
||||||
|
* @see {@link /docs/v2/components#checkbox Checkbox Component Docs}
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-checkbox',
|
selector: 'ion-checkbox',
|
||||||
|
@ -13,6 +13,7 @@ import {Config} from '../../config/config';
|
|||||||
* If there is not an outlined version for the particular icon, it will use the default (full) version.
|
* If there is not an outlined version for the particular icon, it will use the default (full) version.
|
||||||
* @property {string} [ios] - Explicitly set the icon to use on iOS.
|
* @property {string} [ios] - Explicitly set the icon to use on iOS.
|
||||||
* @property {string} [md] - Explicitly set the icon to use on Android.
|
* @property {string} [md] - Explicitly set the icon to use on Android.
|
||||||
|
* @see {@link /docs/v2/components#icons Icon Component Docs}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
|
@ -37,6 +37,8 @@ import {Component} from 'angular2/angular2';
|
|||||||
* </ion-list>
|
* </ion-list>
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
|
* @see {@link /docs/v2/components#lists List Component Docs}
|
||||||
|
* @see {@link ../../list/List List API Docs}
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-item,[ion-item]',
|
selector: 'ion-item,[ion-item]',
|
||||||
|
@ -16,6 +16,7 @@ import * as util from 'ionic/util';
|
|||||||
* Using the List and Item components make it easy to support various
|
* Using the List and Item components make it easy to support various
|
||||||
* interaction modes such as swipe to edit, drag to reorder, and removing items.
|
* interaction modes such as swipe to edit, drag to reorder, and removing items.
|
||||||
* @demo /docs/v2/demos/list/
|
* @demo /docs/v2/demos/list/
|
||||||
|
* @see {@link /docs/v2/components#lists List Component Docs}
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -6,6 +6,8 @@ import {IonicApp} from '../app/app';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
|
* @see {@link /docs/v2/components#menus Menu Component Docs}
|
||||||
|
* @see {@link ../../menu/Menu Menu API Docs}
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[menu-close]',
|
selector: '[menu-close]',
|
||||||
|
@ -8,6 +8,8 @@ import {Navbar} from '../navbar/navbar';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
|
* @see {@link /docs/v2/components#menus Menu Component Docs}
|
||||||
|
* @see {@link ../../menu/Menu Menu API Docs}
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[menu-toggle]',
|
selector: '[menu-toggle]',
|
||||||
|
@ -7,6 +7,7 @@ import {Animation} from 'ionic/animations/animation';
|
|||||||
* Base class which is extended by the various types. Each
|
* Base class which is extended by the various types. Each
|
||||||
* type will provide their own animations for open and close
|
* type will provide their own animations for open and close
|
||||||
* and registers itself with Menu.
|
* and registers itself with Menu.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
export class MenuType {
|
export class MenuType {
|
||||||
|
|
||||||
|
@ -42,6 +42,10 @@ import * as gestures from './menu-gestures';
|
|||||||
* ```html
|
* ```html
|
||||||
* <ion-menu [content]="contentRef" type="overlay"></ion-menu>
|
* <ion-menu [content]="contentRef" type="overlay"></ion-menu>
|
||||||
* ```
|
* ```
|
||||||
|
* @see {@link /docs/v2/components#menus Menu Component Docs}
|
||||||
|
* @see {@link /docs/v2/components#navigation Navigation Component Docs}
|
||||||
|
* @see {@link ../../nav/Nav Nav API Docs}
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-menu',
|
selector: 'ion-menu',
|
||||||
|
@ -33,6 +33,7 @@ import {extend} from 'ionic/util';
|
|||||||
*
|
*
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
* @see {@link /docs/v2/components#modals Modal Component Docs}
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Modal {
|
export class Modal {
|
||||||
|
@ -97,6 +97,7 @@ import {raf, rafFrames} from '../../util/dom';
|
|||||||
* - `onPageWillUnload` - Runs when the page is about to be destroyed and have its elements removed.
|
* - `onPageWillUnload` - Runs when the page is about to be destroyed and have its elements removed.
|
||||||
* - `onPageDidUnload` - Runs after the page has been destroyed and its elements have been removed.
|
* - `onPageDidUnload` - Runs after the page has been destroyed and its elements have been removed.
|
||||||
*
|
*
|
||||||
|
* @see {@link /docs/v2/components#navigation Navigation Component Docs}
|
||||||
*/
|
*/
|
||||||
export class NavController extends Ion {
|
export class NavController extends Ion {
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ import {NavRegistry} from './nav-registry';
|
|||||||
* ```html
|
* ```html
|
||||||
* <button [nav-push]="[pushPage, params]"></button>
|
* <button [nav-push]="[pushPage, params]"></button>
|
||||||
* ```
|
* ```
|
||||||
|
* @see {@link /docs/v2/components#navigation Navigation Component Docs}
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[nav-push]',
|
selector: '[nav-push]',
|
||||||
|
@ -96,6 +96,7 @@ import {ViewController} from './view-controller';
|
|||||||
* </pre>
|
* </pre>
|
||||||
* </div>
|
* </div>
|
||||||
*
|
*
|
||||||
|
* @see {@link /docs/v2/components#navigation Navigation Component Docs}
|
||||||
*/
|
*/
|
||||||
@ConfigComponent({
|
@ConfigComponent({
|
||||||
selector: 'ion-nav',
|
selector: 'ion-nav',
|
||||||
|
@ -61,6 +61,7 @@ import {extend} from '../../util/util';
|
|||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
* @see {@link /docs/v2/components#popups Popup Component Docs}
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Popup {
|
export class Popup {
|
||||||
|
@ -40,6 +40,7 @@ import {ListHeader} from '../list/list';
|
|||||||
*
|
*
|
||||||
* </ion-list>
|
* </ion-list>
|
||||||
* ```
|
* ```
|
||||||
|
* @see {@link /docs/v2/components#radio Radio Component Docs}
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[radio-group]',
|
selector: '[radio-group]',
|
||||||
@ -162,6 +163,7 @@ export class RadioGroup extends Ion {
|
|||||||
* </ion-radio>
|
* </ion-radio>
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
* @see {@link /docs/v2/components#radio Radio Component Docs}
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-radio',
|
selector: 'ion-radio',
|
||||||
|
@ -20,6 +20,7 @@ import {Icon} from '../icon/icon';
|
|||||||
* @property [show-cancel] - shows the cancel button based on boolean value passed in
|
* @property [show-cancel] - shows the cancel button based on boolean value passed in
|
||||||
* @property [cancel-text] - sets the cancel button text to the value passed in
|
* @property [cancel-text] - sets the cancel button text to the value passed in
|
||||||
* @property [cancel-action] - the function that gets called by clicking the cancel button
|
* @property [cancel-action] - the function that gets called by clicking the cancel button
|
||||||
|
* @see {@link /docs/v2/components#search Search Component Docs}
|
||||||
*/
|
*/
|
||||||
@ConfigComponent({
|
@ConfigComponent({
|
||||||
selector: 'ion-searchbar',
|
selector: 'ion-searchbar',
|
||||||
|
@ -44,6 +44,7 @@ ion-segment {
|
|||||||
ion-segment-button[button][outline].activated,
|
ion-segment-button[button][outline].activated,
|
||||||
ion-segment-button[button][outline].segment-activated {
|
ion-segment-button[button][outline].segment-activated {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,8 @@ import {Config} from '../../config/config';
|
|||||||
* </ion-segment>
|
* </ion-segment>
|
||||||
* </form>
|
* </form>
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* @see {@link /docs/v2/components#segment Segment Component Docs}
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'ion-segment'
|
selector: 'ion-segment'
|
||||||
|
@ -64,6 +64,7 @@ import {Scroll} from '../scroll/scroll';
|
|||||||
* @property {Any} [bounce] - whether the slides should bounce
|
* @property {Any} [bounce] - whether the slides should bounce
|
||||||
* @property [pager] - add this property to enable the slide pager
|
* @property [pager] - add this property to enable the slide pager
|
||||||
* @property {Any} [slideChanged] - expression to evaluate when a slide has been changed
|
* @property {Any} [slideChanged] - expression to evaluate when a slide has been changed
|
||||||
|
* @see {@link /docs/v2/components#slides Slides Component Docs}
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-slides',
|
selector: 'ion-slides',
|
||||||
|
@ -65,6 +65,7 @@ class MediaSwitch {
|
|||||||
* </ion-list>
|
* </ion-list>
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
* @see {@link /docs/v2/components#switch Switch Component Docs}
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-switch',
|
selector: 'ion-switch',
|
||||||
|
@ -31,8 +31,8 @@ import {rafFrames} from '../../util/dom';
|
|||||||
* individual Tab components. On iOS, the TabBar is placed on the bottom of
|
* individual Tab components. On iOS, the TabBar is placed on the bottom of
|
||||||
* the screen, while on Android it is at the top.
|
* the screen, while on Android it is at the top.
|
||||||
*
|
*
|
||||||
* See the [Tab API reference](../Tab/) for more details on individual Tab components.
|
* @see {@link /docs/v2/components#tabs Tabs Component Docs}
|
||||||
*
|
* @see {@link ../Tab Tab API Docs}
|
||||||
*/
|
*/
|
||||||
@ConfigComponent({
|
@ConfigComponent({
|
||||||
selector: 'ion-tabs',
|
selector: 'ion-tabs',
|
||||||
|
@ -22,7 +22,7 @@ const DB_NAME = '__ionicstorage';
|
|||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* // Sql storage also exposes the full engine underneath
|
* // Sql storage also exposes the full engine underneath
|
||||||
* storage.query('insert into projects(name, data) values('Cool Project', 'blah');'
|
* storage.query('insert into projects(name, data) values('Cool Project', 'blah')');
|
||||||
* storage.query('select * from projects').then((resp) => {})
|
* storage.query('select * from projects').then((resp) => {})
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@ -39,7 +39,7 @@ export class SqlStorage extends StorageEngine {
|
|||||||
static BACKUP_LIBRARY = 1
|
static BACKUP_LIBRARY = 1
|
||||||
static BACKUP_DOCUMENTS = 0
|
static BACKUP_DOCUMENTS = 0
|
||||||
|
|
||||||
constructor(options) {
|
constructor(options={}) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
let dbOptions = util.defaults(options, {
|
let dbOptions = util.defaults(options, {
|
||||||
@ -98,19 +98,25 @@ export class SqlStorage extends StorageEngine {
|
|||||||
*/
|
*/
|
||||||
query(query, ...params) {
|
query(query, ...params) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this._db.transaction((tx) => {
|
try {
|
||||||
tx.executeSql(query, params, (tx, res) => {
|
this._db.transaction((tx) => {
|
||||||
resolve({
|
tx.executeSql(query, params, (tx, res) => {
|
||||||
tx: tx,
|
resolve({
|
||||||
res: res
|
tx: tx,
|
||||||
});
|
res: res
|
||||||
}, (tx, err) => {
|
});
|
||||||
reject({
|
}, (tx, err) => {
|
||||||
tx: tx,
|
reject({
|
||||||
err: err
|
tx: tx,
|
||||||
});
|
err: err
|
||||||
})
|
});
|
||||||
});
|
})
|
||||||
|
}, err => {
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
} catch(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ionic-framework",
|
"name": "ionic-framework",
|
||||||
"version": "2.0.0-alpha.39",
|
"version": "2.0.0-alpha.40",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
24
scripts/docs/templates/common.template.html
vendored
24
scripts/docs/templates/common.template.html
vendored
@ -9,6 +9,8 @@ title: "<@ if doc.docType == "directive" @><$ doc.name | dashCase $><@ else @><$
|
|||||||
header_sub_title: "<$ doc.docType | capital $> in module <$ doc.module $>"
|
header_sub_title: "<$ doc.docType | capital $> in module <$ doc.module $>"
|
||||||
doc: "<$ doc.name $>"
|
doc: "<$ doc.name $>"
|
||||||
docType: "<$ doc.docType $>"
|
docType: "<$ doc.docType $>"
|
||||||
|
<@- if doc.demo and false -@>show_preview_device: true
|
||||||
|
preview_device_url= "<$ doc.demo $>"<@- endif -@>
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
@ -84,24 +86,6 @@ docType: "<$ doc.docType $>"
|
|||||||
Improve this doc
|
Improve this doc
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- TODO(drewrygh, perrygovier): render this block in the correct location, markup identical to component docs -->
|
|
||||||
<@- if doc.demo and false -@>
|
|
||||||
<aside id="platform-preview" class="platform-preview">
|
|
||||||
<div class="platform-toggle">
|
|
||||||
<a ng-class="{active: iosActive}"
|
|
||||||
ng-click="setPlatform('ios')">iOS</a>
|
|
||||||
<a ng-class="{active: androidActive}"
|
|
||||||
ng-click="setPlatform('android')">Android</a>
|
|
||||||
</div>
|
|
||||||
<div id="demo-device-ios" ng-class="previewPlatform">
|
|
||||||
<iframe id="demo-ios" src="<$ doc.demo $>" frameborder="0"></iframe>
|
|
||||||
</div>
|
|
||||||
<div id="demo-device-android" ng-class="previewPlatform">
|
|
||||||
<iframe id="demo-ios" src="<$ doc.demo $>" frameborder="0"></iframe>
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
||||||
<@ endif @>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<@ block content @>
|
<@ block content @>
|
||||||
@ -238,8 +222,7 @@ Delegate: <$ doc.delegate $>
|
|||||||
|
|
||||||
<@- if doc.see @>
|
<@- if doc.see @>
|
||||||
|
|
||||||
<h2>Related</h2>
|
<h2>Related</h2>
|
||||||
|
|
||||||
<@ for s in doc.see @>
|
<@ for s in doc.see @>
|
||||||
<$ s | safe $>
|
<$ s | safe $>
|
||||||
<@- endfor -@>
|
<@- endfor -@>
|
||||||
@ -252,4 +235,3 @@ Delegate: <$ doc.delegate $>
|
|||||||
|
|
||||||
<!-- end body block -->
|
<!-- end body block -->
|
||||||
<@ endblock @>
|
<@ endblock @>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user