docs(navController): add api docs

This commit is contained in:
mhartington
2015-11-24 13:22:14 -05:00
parent c2a4b70d31
commit 061f551ef1

View File

@ -144,10 +144,11 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* @param {TODO} componentType TODO * @name NavController#push
* @param {TODO} [params={}] TODO * @param {Component} The name of the component you want to push on the navigation stack
* @param {TODO} [opts={}] TODO * @param {Component} [params={}] The name of the component you want to push on the navigation stack, plus additional data you want to pass as parameters
* @returns {Promise} TODO * @param {Component} [opts={}] The name of the component you want to push on the navigation stack, plus additional options for the transition
* @returns {Promise} Returns a promise when the transition is completed
*/ */
push(componentType, params = {}, opts = {}, callback) { push(componentType, params = {}, opts = {}, callback) {
if (!componentType) { if (!componentType) {
@ -215,8 +216,9 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* @param {TODO} [opts={}] TODO * @name NavController#pop
* @returns {Promise} TODO * @param [opts={}] Any additional option for the transition
* @returns {Promise} Returns a promise when the transition is completed
*/ */
pop(opts = {}) { pop(opts = {}) {
if (!opts.animateFirst && !this.canGoBack()) { if (!opts.animateFirst && !this.canGoBack()) {
@ -307,9 +309,9 @@ export class NavController extends Ion {
/** /**
* Inserts a view into the nav stack at the specified index. * Inserts a view into the nav stack at the specified index.
* @param {TODO} componentType TODO * @param {Component} The name of the component you want to insert into the nav stack
* @param {TODO} index TODO * @param {Index} The index where you want to insert the view
* @returns {Promise} TODO * @returns {Promise} Returns a promise when the view has been inserted into the navigation stack
*/ */
insert(componentType, index, params = {}, opts = {}) { insert(componentType, index, params = {}, opts = {}) {
if (!componentType || index < 0) { if (!componentType || index < 0) {
@ -334,8 +336,8 @@ export class NavController extends Ion {
/** /**
* Removes a view from the nav stack at the specified index. * Removes a view from the nav stack at the specified index.
* @param {TODO} index TODO * @param {Index} Remove the view from the nav stack at that index
* @returns {Promise} TODO * @returns {Promise} Returns a promise when the view has been removed
*/ */
remove(index, opts = {}) { remove(index, opts = {}) {
if (index < 0 || index >= this._views.length) { if (index < 0 || index >= this._views.length) {
@ -419,10 +421,10 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* @param {TODO} componentType TODO * @param {Component} The component you want to make root
* @param {TODO} [params={}] TODO * @param {Component} [params={}] The component you want to make root plus any nav params you want to pass
* @param {TODO} [opts={}] TODO * @param {Component} [opts={}] The component you want to make root plus any transition params you want to pass
* @returns {Promise} TODO * @returns {Promise} Returns a promise when done
*/ */
setRoot(componentType, params = {}, opts = {}) { setRoot(componentType, params = {}, opts = {}) {
return this.setViews([{ return this.setViews([{
@ -432,7 +434,8 @@ export class NavController extends Ion {
} }
/** /**
* TODO *
* @private
* @param {TODO} enteringView TODO * @param {TODO} enteringView TODO
* @param {TODO} leavingView TODO * @param {TODO} leavingView TODO
* @param {TODO} opts TODO * @param {TODO} opts TODO
@ -798,8 +801,8 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* @param {TODO} val TODO * @param {boolean=} isSwipeBackEnabled Set whether or not swipe-to-go-back is enabled
* @returns {TODO} TODO * @returns {boolean} Whether swipe-to-go-back is enabled
*/ */
isSwipeBackEnabled(val) { isSwipeBackEnabled(val) {
if (arguments.length) { if (arguments.length) {
@ -813,7 +816,7 @@ export class NavController extends Ion {
* to go back, or swipe back is not enable then this will return false. * to go back, or swipe back is not enable then this will return false.
* If it is possible to go back, and swipe back is enabled, then this * If it is possible to go back, and swipe back is enabled, then this
* will return true. * will return true.
* @returns {boolean} * @returns {boolean} Whether you can swipe to go back
*/ */
canSwipeBack() { canSwipeBack() {
return (this._sbEnabled && this.canGoBack()); return (this._sbEnabled && this.canGoBack());
@ -822,7 +825,7 @@ export class NavController extends Ion {
/** /**
* Returns `true` if there's a valid previous view that we can pop back to. * Returns `true` if there's a valid previous view that we can pop back to.
* Otherwise returns false. * Otherwise returns false.
* @returns {boolean} * @returns {boolean} Whether there is a view to go back to
*/ */
canGoBack() { canGoBack() {
let activeView = this.getActive(); let activeView = this.getActive();
@ -887,6 +890,7 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* Question for ADAM
* @param {TODO} nbContainer TODO * @param {TODO} nbContainer TODO
* @returns {TODO} TODO * @returns {TODO} TODO
*/ */
@ -961,7 +965,7 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* @returns {TODO} TODO * @returns {Component} TODO
*/ */
getActive() { getActive() {
for (let i = this._views.length - 1; i >= 0; i--) { for (let i = this._views.length - 1; i >= 0; i--) {
@ -974,8 +978,8 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* @param {TODO} index TODO * @param {Index} The index of the view you want to get
* @returns {TODO} TODO * @returns {Component} Returns the component that matches the index given
*/ */
getByIndex(index) { getByIndex(index) {
if (index < this._views.length && index > -1) { if (index < this._views.length && index > -1) {
@ -986,8 +990,8 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* @param {TODO} handle TODO * @param {Handle} The handle of the view you want to get
* @returns {TODO} TODO * @returns {Component} Returns the component that matches the handle given
*/ */
getByHandle(handle) { getByHandle(handle) {
for (let i = 0, ii = this._views.length; i < ii; i++) { for (let i = 0, ii = this._views.length; i < ii; i++) {
@ -1000,6 +1004,7 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* QUESTIONS FOR ADAM
* @param {TODO} pageType TODO * @param {TODO} pageType TODO
* @returns {TODO} TODO * @returns {TODO} TODO
*/ */
@ -1033,7 +1038,7 @@ export class NavController extends Ion {
/** /**
* First view in this nav controller's stack. This would * First view in this nav controller's stack. This would
* not return an view which is about to be destroyed. * not return an view which is about to be destroyed.
* @returns {TODO} TODO * @returns {Component} Returns the first component view in the current stack
*/ */
first() { first() {
for (let i = 0, l = this._views.length; i < l; i++) { for (let i = 0, l = this._views.length; i < l; i++) {
@ -1047,7 +1052,7 @@ export class NavController extends Ion {
/** /**
* Last view in this nav controller's stack. This would * Last view in this nav controller's stack. This would
* not return an view which is about to be destroyed. * not return an view which is about to be destroyed.
* @returns {TODO} TODO * @returns {Component} Returns the last component view in the current stack
*/ */
last() { last() {
for (let i = this._views.length - 1; i >= 0; i--) { for (let i = this._views.length - 1; i >= 0; i--) {
@ -1070,7 +1075,7 @@ export class NavController extends Ion {
/** /**
* Number of sibling views in the nav controller. This does * Number of sibling views in the nav controller. This does
* not include views which are about to be destroyed. * not include views which are about to be destroyed.
* @returns {TODO} TODO * @returns {Number} The number of views in stack, including the current view
*/ */
length() { length() {
let len = 0; let len = 0;
@ -1084,6 +1089,7 @@ export class NavController extends Ion {
/** /**
* TODO * TODO
* IS RETURNING UNDEFIND
* @param {TODO} view TODO * @param {TODO} view TODO
* @returns {TODO} TODO * @returns {TODO} TODO
*/ */
@ -1114,7 +1120,7 @@ let ctrlIds = -1;
*/ */
export class NavParams { export class NavParams {
/** /**
* TODO * @private
* @param {TODO} data TODO * @param {TODO} data TODO
*/ */
constructor(data) { constructor(data) {
@ -1123,7 +1129,7 @@ export class NavParams {
/** /**
* TODO * TODO
* @param {TODO} param TODO * @param {string} Which param you want to look up
*/ */
get(param) { get(param) {
return this.data[param]; return this.data[param];