diff --git a/src/components/nav/view-controller.ts b/src/components/nav/view-controller.ts index 9ab0bcde48..43f273d69e 100644 --- a/src/components/nav/view-controller.ts +++ b/src/components/nav/view-controller.ts @@ -42,11 +42,40 @@ export class ViewController { private _cd: ChangeDetectorRef; protected _nav: NavController; + /** + * Observable to be subscribed to when the current component will become active + * @returns {Observable} Returns an observable + */ willEnter: EventEmitter; + + /** + * Observable to be subscribed to when the current component has become active + * @returns {Observable} Returns an observable + */ didEnter: EventEmitter; + + /** + * Observable to be subscribed to when the current component will no longer be active + * @returns {Observable} Returns an observable + */ willLeave: EventEmitter; + + /** + * Observable to be subscribed to when the current component is no long active + * @returns {Observable} Returns an observable + */ didLeave: EventEmitter; + + /** + * Observable to be subscribed to when the current component will be destroyed + * @returns {Observable} Returns an observable + */ willUnload: EventEmitter; + + /** + * Observable to be subscribed to when the current component has been destroyed + * @returns {Observable} Returns an observable + */ didUnload: EventEmitter; /** @@ -226,17 +255,7 @@ export class ViewController { } /** - * You can find out the index of the current view is in the current navigation stack. - * - * ```ts - * export class Page1 { - * constructor(private view: ViewController){ - * // Just log out the index - * console.log(this.view.index); - * } - * } - * ``` - * + * Get the index of the current component in the current navigation stack. * @returns {number} Returns the index of this page within its `NavController`. */ get index(): number { @@ -387,20 +406,10 @@ export class ViewController { } /** - * You can find out of the current view has a Navbar or not. Be sure + * + * Find out if the current component has a NavBar or not. Be sure * to wrap this in an `ionViewWillEnter` method in order to make sure * the view has rendered fully. - * - * ```ts - * export class Page1 { - * constructor(private viewCtrl: ViewController) {} - * - * ionViewWillEnter(){ - * console.log('Do we have a Navbar?', this.viewCtrl.hasNavbar()); - * } - *} - * ``` - * * @returns {boolean} Returns a boolean if this Page has a navbar or not. */ hasNavbar(): boolean { @@ -456,19 +465,8 @@ export class ViewController { } /** - * You can change the text of the back button on a view-by-view basis. - * - * ```ts - * export class MyClass{ - * constructor(private viewCtrl: ViewController) {} - * - * ionViewWillEnter() { - * this.viewCtrl.setBackButtonText('Previous'); - * } - * } - * ``` - * Make sure you use the view events when calling this method, otherwise the back-button will not have been created - * + * Change the title of the back-button. Be sure to call this + * after `ionViewWillEnter` to make sure the DOM has been rendered. * @param {string} backButtonText Set the back button text. */ setBackButtonText(val: string) { @@ -479,7 +477,8 @@ export class ViewController { } /** - * Set if the back button for the current view is visible or not. Be sure to wrap this in `ionViewWillEnter` to make sure the has been compleltly rendered. + * Set if the back button for the current view is visible or not. Be sure to call this + * after `ionViewWillEnter` to make sure the DOM has been rendered. * @param {boolean} Set if this Page's back button should show or not. */ showBackButton(shouldShow: boolean) { diff --git a/src/components/picker/picker.ts b/src/components/picker/picker.ts index 29c4cf94a5..8a65ad0fa7 100644 --- a/src/components/picker/picker.ts +++ b/src/components/picker/picker.ts @@ -93,6 +93,7 @@ export class Picker extends ViewController { /** + * @private * @name PickerController * @description * @@ -109,4 +110,4 @@ export class PickerController { return new Picker(this._app, opts); } -} \ No newline at end of file +} diff --git a/src/components/popover/popover.ts b/src/components/popover/popover.ts index 6c090b8d08..50a5be2599 100644 --- a/src/components/popover/popover.ts +++ b/src/components/popover/popover.ts @@ -146,6 +146,15 @@ export class Popover extends ViewController { * } * } * ``` + * @advanced + * Popover Options + * + * | Option | Type | Description | + * |-----------------------|------------|------------------------------------------------------------------------------------------------------------------| + * | cssClass |`string` | An additional class for custom styles. | + * | showBackdrop |`boolean` | Whether to show the backdrop. Default true. | + * | enableBackdropDismiss |`boolean` | Whether the popover should be dismissed by tapping the backdrop. Default true. | + * * * * @demo /docs/v2/demos/popover/ @@ -156,15 +165,7 @@ export class PopoverController { constructor(private _app: App) {} /** - * Create a popover with the following options - * - * | Option | Type | Description | - * |-----------------------|------------|------------------------------------------------------------------------------------------------------------------| - * | cssClass |`string` | An additional class for custom styles. | - * | showBackdrop |`boolean` | Whether to show the backdrop. Default true. | - * | enableBackdropDismiss |`boolean` | Whether the popover should be dismissed by tapping the backdrop. Default true. | - * - * + * Present a popover. See below for options * @param {object} componentType The Popover * @param {object} data Any data to pass to the Popover view * @param {PopoverOptions} opts Popover options diff --git a/src/components/toast/toast.ts b/src/components/toast/toast.ts index 0f2c75f934..05b525d9b1 100644 --- a/src/components/toast/toast.ts +++ b/src/components/toast/toast.ts @@ -126,6 +126,16 @@ export class Toast extends ViewController { * toast.present(); * } * ``` + * @advanced + * | Property | Type | Default | Description | + * |-----------------------|-----------|-----------------|---------------------------------------------------------------------------------------------------------------| + * | message | `string` | - | The message for the toast. Long strings will wrap and the toast container will expand. | + * | duration | `number` | - | How many milliseconds to wait before hiding the toast. By default, it will show until `dismiss()` is called. | + * | position | `string` | "bottom" | The position of the toast on the screen. Accepted values: "top", "middle", "bottom". | + * | cssClass | `string` | - | Any additional class for custom styles. | + * | showCloseButton | `boolean` | false | Whether or not to show a button to close the toast. | + * | closeButtonText | `string` | "Close" | Text to display in the close button. | + * | dismissOnPageChange | `boolean` | false | Whether to dismiss the toast when navigating to a new page. | * * @demo /docs/v2/demos/toast/ */ @@ -135,19 +145,7 @@ export class ToastController { constructor(private _app: App) {} /** - * - * Toast options - * - * | Property | Type | Default | Description | - * |-----------------------|-----------|-----------------|---------------------------------------------------------------------------------------------------------------| - * | message | `string` | - | The message for the toast. Long strings will wrap and the toast container will expand. | - * | duration | `number` | - | How many milliseconds to wait before hiding the toast. By default, it will show until `dismiss()` is called. | - * | position | `string` | "bottom" | The position of the toast on the screen. Accepted values: "top", "middle", "bottom". | - * | cssClass | `string` | - | Any additional class for custom styles. | - * | showCloseButton | `boolean` | false | Whether or not to show a button to close the toast. | - * | closeButtonText | `string` | "Close" | Text to display in the close button. | - * | dismissOnPageChange | `boolean` | false | Whether to dismiss the toast when navigating to a new page. | - * + * Create a new toast component. See options below * @param {ToastOptions} opts Toast options. See the above table for available options. */ create(opts: ToastOptions = {}) { diff --git a/src/gestures/slide-edge-gesture.ts b/src/gestures/slide-edge-gesture.ts index ea98eb956f..74b5d18567 100644 --- a/src/gestures/slide-edge-gesture.ts +++ b/src/gestures/slide-edge-gesture.ts @@ -2,7 +2,9 @@ import {SlideGesture} from './slide-gesture'; import {defaults} from '../util/util'; import {windowDimensions} from '../util/dom'; - +/** + * @private + */ export class SlideEdgeGesture extends SlideGesture { public edges: Array; public maxEdgeStart: any; diff --git a/src/gestures/slide-gesture.ts b/src/gestures/slide-gesture.ts index e8fcb6b18b..dca0d0f19f 100644 --- a/src/gestures/slide-gesture.ts +++ b/src/gestures/slide-gesture.ts @@ -2,6 +2,9 @@ import {DragGesture} from './drag-gesture'; import {clamp} from '../util'; +/** + * @private + */ export class SlideGesture extends DragGesture { public slide: SlideData = null; diff --git a/src/util/util.ts b/src/util/util.ts index fc2dbddb4f..2879bf528c 100644 --- a/src/util/util.ts +++ b/src/util/util.ts @@ -177,6 +177,9 @@ export function getQuerystring(url: string): any { } +/** + * @private + */ export function reorderArray(array: any[], indexes: {from: number, to: number}): any[] { let element = array[indexes.from]; array.splice(indexes.from, 1);