This commit is contained in:
Tim Lancina
2015-08-28 11:16:17 -07:00
parent ea142dd6a7
commit 91bb745e50
7 changed files with 108 additions and 19 deletions

View File

@@ -58,7 +58,9 @@ class ActionMenuDirective {
}
}
/**
* TODO
*/
@Injectable()
export class ActionMenu extends Overlay {
/**
@@ -67,7 +69,6 @@ export class ActionMenu extends Overlay {
*
* @return Promise that resolves when the action menu is open.
*/
open(opts={}) {
let config = this.config;
let defaults = {
@@ -82,6 +83,9 @@ export class ActionMenu extends Overlay {
return this.create(OVERLAY_TYPE, ActionMenuDirective, context, context);
}
/**
* TODO
*/
get() {
return Modal.getByType(OVERLAY_TYPE);
}

View File

@@ -11,9 +11,14 @@ import {Modal} from '../modal/modal';
import {Popup} from '../popup/popup';
import {FocusHolder} from '../form/focus-holder';
/**
* TODO
*/
export class IonicApp {
/**
* TODO
*/
constructor() {
this.overlays = [];
@@ -21,11 +26,20 @@ export class IonicApp {
this.components = {};
}
/**
* TODO
* @param {Object} appRef TODO
*/
load(appRef) {
this.ref(appRef);
this._zone = appRef.injector.get(NgZone);
}
/**
* TODO
* @param {TODO=} val TODO
* @return {TODO} TODO
*/
focusHolder(val) {
if (arguments.length) {
this._focusHolder = val;
@@ -33,10 +47,19 @@ export class IonicApp {
return this._focusHolder;
}
/**
* Sets the document title.
* @param {string} val Value to set the document title to.
*/
title(val) {
document.title = val;
}
/**
* TODO
* @param {TODO=} val TODO
* @return TODO
*/
ref(val) {
if (arguments.length) {
this._ref = val;
@@ -44,16 +67,26 @@ export class IonicApp {
return this._ref;
}
/**
* TODO
* @return TODO
*/
get injector() {
return this._ref.injector;
}
/**
* TODO
* @param {Function} fn TODO
*/
zoneRun(fn) {
this._zone.run(fn);
}
/**
* Register a known component with a key, for easy lookups later.
* @param {TODO} key TODO
* @param {TODO} component TODO
*/
register(key, component) {
this.components[key] = component;
@@ -62,11 +95,18 @@ export class IonicApp {
/**
* Unregister a known component with a key.
* @param {TODO} key TODO
* @param {TODO} component TODO
*/
unregister(key, component) {
unregister(key, component) {
delete this.components[key];
}
/**
* TODO
* @param {Object} cls TODO
* @return TODO
*/
getRegisteredComponent(cls) {
for(let component of this.components) {
if(component instanceof cls) {
@@ -77,6 +117,8 @@ export class IonicApp {
/**
* Get the component for the given key.
* @param {TODO} key TODO
* @return {TODO} TODO
*/
getComponent(key) {
return this.components[key];
@@ -86,13 +128,20 @@ export class IonicApp {
* Create and append the given component into the root
* element of the app.
*
* @param Component the component to create and insert
* @return Promise that resolves with the ContainerRef created
* @param {TODO} componentType the component to create and insert
* @return {Promise} Promise that resolves with the ContainerRef created
*/
appendComponent(componentType: Type, context=null) {
appendComponent(componentType: Type) {
return this.rootAnchor.append(componentType);
}
/**
* TODO
*
* @param {Element} bodyEle the body element
* @param {TODO} platform TODO
* @param {TODO} config TODO
*/
applyBodyCss(bodyEle, platform, config) {
let versions = platform.versions();
platform.platforms().forEach(platformName => {
@@ -130,6 +179,13 @@ export class IonicApp {
bodyEle.setAttribute('mode', config.setting('mode'));
}
/**
* If val is defined, specifies whether app text is RTL. If val is undefined
* returns whether app text is RTL.
*
* @param {boolean=} val Boolean specifying whether text is RTL or not.
* @returns {boolean} true if app text is RTL, false if otherwise.
*/
isRTL(val) {
if (arguments.length) {
this._rtl = val;
@@ -179,6 +235,13 @@ class RootAnchor {
}
}
/**
* TODO
*
* @param {TODO} rootComponentType TODO
* @param {TODO} config TODO
* @return {Promise} TODO
*/
export function ionicBootstrap(rootComponentType, config) {
return new Promise(resolve => {
try {

View File

@@ -22,9 +22,12 @@ import {
MaterialButton
} from '../ionic';
// TODO: Why is forwardRef() required when they're already imported above????
/**
* The core Ionic directives. Automatically available in every IonicView
* template.
*/
export const IonicDirectives = [
// TODO: Why is forwardRef() required when they're already imported above????
// Angular
CORE_DIRECTIVES,
FORM_DIRECTIVES,
@@ -99,6 +102,9 @@ class IonicViewImpl extends View {
}
}
/**
* TODO
*/
export function IonicView(args) {
return function(cls) {
var annotations = Reflect.getMetadata('annotations', cls) || [];
@@ -108,6 +114,9 @@ export function IonicView(args) {
}
}
/**
* TODO
*/
export function IonicDirective(config) {
return function(cls) {
var annotations = Reflect.getMetadata('annotations', cls) || [];
@@ -117,6 +126,9 @@ export function IonicDirective(config) {
}
}
/**
* TODO
*/
export function IonicComponent(config) {
return function(cls) {
var annotations = Reflect.getMetadata('annotations', cls) || [];
@@ -153,6 +165,9 @@ function appendConfig(cls, config) {
return config;
}
/**
* TODO
*/
export function App(args={}) {
return function(cls) {
// get current annotations

View File

@@ -2,11 +2,14 @@
import {isObject, isDefined, isFunction, extend} from '../util/util';
/**
* This is the Ionic Config
* @usage this is what you do to use it
* TODO
*/
export class IonicConfig {
/**
* TODO
* @param {Object} settings The settings for your app
*/
constructor(settings) {
// defaults
@@ -18,7 +21,7 @@ export class IonicConfig {
}
}
/**
* @description The settings description
* TODO
*/
setting() {
const args = arguments;
@@ -132,7 +135,8 @@ export class IonicConfig {
}
/**
* The setPlatform description
* TODO
* @param {Object} platform The platform
*/
setPlatform(platform) {
// get the array of active platforms, which also knows the hierarchy,

View File

@@ -9,12 +9,15 @@ var path = require('path');
// Define the dgeni package for generating the docs
module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, typescriptPackage, linksPackage, gitPackage])
//for debugging docs
// for debugging docs
// .processor(function test(){
// return {
// $runAfter: ['files-written'],
// $process: function(docs){
// docs.forEach(function(doc){
// if (doc.constructorDoc){
// debugger;
// }
// })
// }
// }

View File

@@ -1,6 +1,6 @@
{% macro paramList(params) -%}
{%- if params -%}<span class="params">(
{%- for param in params -%}
{% macro paramList(paramData) -%}
{%- if paramData -%}<span class="params">(
{%- for param in paramData -%}
<span class="param">{$ param | escape $}{% if not loop.last %}, {% endif %}</span>
{%- endfor %})</span>
{%- endif %}
@@ -28,7 +28,7 @@ defined in {$ githubViewLink(doc) $}
{%- if doc.constructorDoc %}
<section class="member constructor">
<h1 id="constructor" class="name">{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.params) $}</h1>
<h1 id="constructor" class="name">{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.paramData) $}</h1>
{% marked %}
{$ doc.constructorDoc.description $}
{% endmarked %}

View File

@@ -1,5 +1,5 @@
<h1>{$ doc.id $}</h1>
{%- for export in doc.exports %}
<a href="/docs/{$ export.outputPath $}">{$ export.name $}</a>
<a href="/docs/{$ export.outputPath $}">{$ export.name $}</a></br>
{% endfor %}