docs(): docs

This commit is contained in:
mhartington
2015-12-02 17:55:44 -05:00
parent f32a198364
commit 4bd6ac825d
5 changed files with 82 additions and 11 deletions

View File

@ -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)
* of the Component docs._
*
@ -159,9 +166,7 @@ export class Tabs extends Ion {
}
/**
* TODO
* @param {Tab} tab TODO
* @returns {TODO} TODO
* @param {Number} index Index of the tab you want to select
*/
select(tabOrIndex) {
let selectedTab = (typeof tabOrIndex === 'number' ? this.getByIndex(tabOrIndex) : tabOrIndex);
@ -212,9 +217,8 @@ export class Tabs extends Ion {
}
/**
* TODO
* @param {TODO} index TODO
* @returns {TODO} TODO
* @param {Number} index Index of the tab you want to get
* @returns {Any} Tab Returs the tab who's index matches the one passed
*/
getByIndex(index) {
if (index < this._tabs.length && index > -1) {
@ -223,6 +227,9 @@ export class Tabs extends Ion {
return null;
}
/**
* @return {Any} Tab Returns the currently selected tab
*/
getSelected() {
for (let i = 0; i < this._tabs.length; i++) {
if (this._tabs[i].isSelected) {
@ -232,6 +239,9 @@ export class Tabs extends Ion {
return null;
}
/**
* @private
*/
getIndex(tab) {
return this._tabs.indexOf(tab);
}

View File

@ -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({
selector: 'ion-input',
host: {
@ -504,6 +533,9 @@ export class TextInputElement {
}
/**
* @private
*/
@Directive({
selector: '[scroll-assist]',
host: {

View File

@ -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({
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({
selector: 'ion-title',
template:
@ -106,7 +131,9 @@ export class ToolbarTitle extends Ion {
toolbar && toolbar.setTitleCmp(this);
navbar && navbar.setTitleCmp(this);
}
/**
* @private
*/
getTitleText() {
return this.getNativeElement().textContent;
}

View File

@ -1,6 +1,7 @@
import {Injectable} from 'angular2/angular2';
/**
* @private
* 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
* to provide strings for your default language, just new languages.

View File

@ -3,6 +3,7 @@ import {Injectable, Pipe, PipeTransform} from 'angular2/angular2';
import {Translate} from './translate';
/**
* @private
* The Translate pipe makes it easy to translate strings.
*
* @usage