From 6f8f2ab83fb490f6d68428c02bc243b3785dab28 Mon Sep 17 00:00:00 2001 From: mhartington Date: Wed, 8 Jun 2016 11:38:04 -0400 Subject: [PATCH] docs(ionicBoostrap): add docs --- src/config/bootstrap.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/config/bootstrap.ts b/src/config/bootstrap.ts index b43235dae8..ef12f4873a 100644 --- a/src/config/bootstrap.ts +++ b/src/config/bootstrap.ts @@ -23,6 +23,25 @@ import {Translate} from '../translation/translate'; const _reflect: any = Reflect; +/** + * @name ionicBoostrap + * @description + * `ionicBootstrap` allows you to bootstrap your entire application. Similar to Angualr's `bootstrap`, `ionicBootstrap` + * takes a root component in order to start the app. You can pass along any providers that you may want to inject into your + * app as an array for the second argument. You can also pass a config object as the third argument to configure your app's settings. + * + * @usage + * import {ionicBootstrap} from 'ionic-angular'; + * import {Component} from '@angular/core'; + * + * @Component({ + * templateUrl: 'build/app.html', + * }) + * + * export class MyClass{} + * + * ionicBootstrap(MyClass, null, {tabbarPlacement: 'bottom'}) + */ export function ionicBootstrap(appRootComponent: any, customProviders?: Array, config?: any): Promise> { // get all Ionic Providers let providers = ionicProviders(customProviders, config); @@ -38,6 +57,9 @@ export function ionicBootstrap(appRootComponent: any, customProviders?: Array): ComponentRef { let app: App = ngComponentRef.injector.get(App); app.setAppInjector(ngComponentRef.injector); @@ -56,6 +78,9 @@ export function ionicPostBootstrap(ngComponentRef: ComponentRef): Component return ngComponentRef; } + /** + * @private + */ export function ionicProviders(customProviders?: Array, config?: any): any[] { let directives = IONIC_DIRECTIVES;