diff --git a/ionic/components.js b/ionic/components.js index c2a97e6789..e3a5d5851b 100644 --- a/ionic/components.js +++ b/ionic/components.js @@ -1,4 +1,5 @@ // DON'T reference this file in the source. Only in demos. +export * from 'ionic/components/app/app' export * from 'ionic/components/action-menu/action-menu' // export * from 'ionic/components/alert/alert' export * from 'ionic/components/aside/aside' diff --git a/ionic/components/action-menu/test/basic/index.js b/ionic/components/action-menu/test/basic/index.js index 0e115129d1..43d376a64e 100644 --- a/ionic/components/action-menu/test/basic/index.js +++ b/ionic/components/action-menu/test/basic/index.js @@ -2,7 +2,7 @@ import {bootstrap} from 'angular2/angular2' import {Component} from 'angular2/src/core/annotations_impl/annotations'; import {View} from 'angular2/src/core/annotations_impl/view'; -import {Button, Content} from 'ionic/ionic'; +import {Ionic, Button, Content} from 'ionic/ionic'; import {ActionMenu} from 'ionic/components/action-menu/action-menu'; @@ -11,8 +11,9 @@ import {ActionMenu} from 'ionic/components/action-menu/action-menu'; templateUrl: 'main.html', directives: [Button, Content] }) -class IonicApp { +class IonicApp extends Ionic { constructor() { + super(); console.log('IonicApp Start') } @@ -25,5 +26,7 @@ class IonicApp { } export function main() { - bootstrap(IonicApp); + bootstrap(IonicApp).then((appRef) => { + appRef.hostComponent.setAppRef(appRef); + }) } diff --git a/ionic/components/app/app.js b/ionic/components/app/app.js new file mode 100644 index 0000000000..676b3c1049 --- /dev/null +++ b/ionic/components/app/app.js @@ -0,0 +1,15 @@ +import {ApplicationRef} from 'angular2/angular2'; + +export class Ionic { + constructor() { + + } + + setAppRef(appRef: ApplicationRef) { + this.appRef = appRef; + console.log('Got app ref', appRef); + } + getAppRef() { + return this.appRef; + } +}