mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
docs(): docs
This commit is contained in:
@ -12,6 +12,13 @@ import {rafFrames} from '../../util/dom';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @name Tabs
|
||||||
|
* @property
|
||||||
|
* @property [tabbar-placement] - set position of the tabbar, top or bottom
|
||||||
|
* @property [tabbar-icons] - set the position of the tabbar's icons: top, bottom, left, right, hide
|
||||||
|
* @property [tabbar-style] - sets tabbar's style (primary, secondary, etc)
|
||||||
|
* @property [preload-tabs] - sets whether to preload all the tabs, true or false
|
||||||
|
* @description
|
||||||
* _For basic Tabs usage, see the [Tabs section](../../../../components/#tabs)
|
* _For basic Tabs usage, see the [Tabs section](../../../../components/#tabs)
|
||||||
* of the Component docs._
|
* of the Component docs._
|
||||||
*
|
*
|
||||||
@ -159,9 +166,7 @@ export class Tabs extends Ion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* @param {Number} index Index of the tab you want to select
|
||||||
* @param {Tab} tab TODO
|
|
||||||
* @returns {TODO} TODO
|
|
||||||
*/
|
*/
|
||||||
select(tabOrIndex) {
|
select(tabOrIndex) {
|
||||||
let selectedTab = (typeof tabOrIndex === 'number' ? this.getByIndex(tabOrIndex) : tabOrIndex);
|
let selectedTab = (typeof tabOrIndex === 'number' ? this.getByIndex(tabOrIndex) : tabOrIndex);
|
||||||
@ -212,9 +217,8 @@ export class Tabs extends Ion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* @param {Number} index Index of the tab you want to get
|
||||||
* @param {TODO} index TODO
|
* @returns {Any} Tab Returs the tab who's index matches the one passed
|
||||||
* @returns {TODO} TODO
|
|
||||||
*/
|
*/
|
||||||
getByIndex(index) {
|
getByIndex(index) {
|
||||||
if (index < this._tabs.length && index > -1) {
|
if (index < this._tabs.length && index > -1) {
|
||||||
@ -223,6 +227,9 @@ export class Tabs extends Ion {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {Any} Tab Returns the currently selected tab
|
||||||
|
*/
|
||||||
getSelected() {
|
getSelected() {
|
||||||
for (let i = 0; i < this._tabs.length; i++) {
|
for (let i = 0; i < this._tabs.length; i++) {
|
||||||
if (this._tabs[i].isSelected) {
|
if (this._tabs[i].isSelected) {
|
||||||
@ -232,6 +239,9 @@ export class Tabs extends Ion {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
getIndex(tab) {
|
getIndex(tab) {
|
||||||
return this._tabs.indexOf(tab);
|
return this._tabs.indexOf(tab);
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,37 @@ import {Platform} from '../../platform/platform';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* @name Input
|
||||||
|
* @module ionic
|
||||||
|
* @description
|
||||||
|
* `ionInput` is a generic wrapper for both inputs and textareas. You can give `ion-input` to tell it how to handle a chile `ion-label` component
|
||||||
|
* @property [fixed-labels] - a persistant label that sits next the the input
|
||||||
|
* @property [floating-labels] - a label that will float about the input if the input is empty of looses focus
|
||||||
|
* @property [stacked-labels] - A stacked label will always appear on top of the input
|
||||||
|
* @usage
|
||||||
|
* ```html
|
||||||
|
* <ion-input>
|
||||||
|
* <ion-label>Username</ion-label>
|
||||||
|
* <input type="text" value="">
|
||||||
|
* </ion-input>
|
||||||
|
*
|
||||||
|
* <ion-input>
|
||||||
|
* <input type="text" placeholder="Username">
|
||||||
|
* </ion-input>
|
||||||
|
*
|
||||||
|
* <ion-input fixed-label>
|
||||||
|
* <ion-label>Username</ion-label>
|
||||||
|
* <input type="text" value="">
|
||||||
|
* </ion-input>
|
||||||
|
*
|
||||||
|
* <ion-input floating-label>
|
||||||
|
* <ion-label>Username</ion-label>
|
||||||
|
* <input type="text" value="">
|
||||||
|
* </ion-input>
|
||||||
|
* ```
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-input',
|
selector: 'ion-input',
|
||||||
host: {
|
host: {
|
||||||
@ -504,6 +533,9 @@ export class TextInputElement {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[scroll-assist]',
|
selector: '[scroll-assist]',
|
||||||
host: {
|
host: {
|
||||||
|
@ -60,9 +60,19 @@ export class ToolbarBase extends Ion {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* @name Toolbar
|
||||||
|
* @description
|
||||||
|
* The toolbar is generic bar that sits above content.
|
||||||
|
* Unlike an `ionNavbar`, `ionToolbar` can be used for a subheader as well.
|
||||||
|
* @usage
|
||||||
|
* ```html
|
||||||
|
* <ion-toolbar>
|
||||||
|
* <ion-title>My Toolbar Title</ion-title>
|
||||||
|
* </ion-toolbar>
|
||||||
|
*
|
||||||
|
* <ion-content></ion-content>
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-toolbar',
|
selector: 'ion-toolbar',
|
||||||
@ -88,7 +98,22 @@ export class Toolbar extends ToolbarBase {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name ToolbarTitle
|
||||||
|
* @description
|
||||||
|
* `ion-title` is a component that sets the title of the `ionToolbar` or `ionNavbar`
|
||||||
|
* @usage
|
||||||
|
* ```html
|
||||||
|
* <ion-navbar *navbar>
|
||||||
|
* <ion-title>Tab 1</ion-title>
|
||||||
|
* </ion-navbar>
|
||||||
|
*
|
||||||
|
*<!-- or if you wanted to crate a subheader title-->
|
||||||
|
* <ion-toolbar>
|
||||||
|
* <ion-title>SubHeader</ion-title>
|
||||||
|
* </ion-toolbar>
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-title',
|
selector: 'ion-title',
|
||||||
template:
|
template:
|
||||||
@ -106,7 +131,9 @@ export class ToolbarTitle extends Ion {
|
|||||||
toolbar && toolbar.setTitleCmp(this);
|
toolbar && toolbar.setTitleCmp(this);
|
||||||
navbar && navbar.setTitleCmp(this);
|
navbar && navbar.setTitleCmp(this);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
getTitleText() {
|
getTitleText() {
|
||||||
return this.getNativeElement().textContent;
|
return this.getNativeElement().textContent;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import {Injectable} from 'angular2/angular2';
|
import {Injectable} from 'angular2/angular2';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @private
|
||||||
* Provide multi-language and i18n support in your app. Translate works by
|
* Provide multi-language and i18n support in your app. Translate works by
|
||||||
* mapping full strings to language translated ones. That means that you don't need
|
* mapping full strings to language translated ones. That means that you don't need
|
||||||
* to provide strings for your default language, just new languages.
|
* to provide strings for your default language, just new languages.
|
||||||
|
@ -3,6 +3,7 @@ import {Injectable, Pipe, PipeTransform} from 'angular2/angular2';
|
|||||||
import {Translate} from './translate';
|
import {Translate} from './translate';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @private
|
||||||
* The Translate pipe makes it easy to translate strings.
|
* The Translate pipe makes it easy to translate strings.
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
|
Reference in New Issue
Block a user