# Reference App Component

**URL:** <https://forum.ionicframework.com/t/reference-app-component/64823>\
**Category:** ionic-v3\
**Created:** [September 28, 2016, 1:20pm UTC](https://forum.ionicframework.com/t/reference-app-component/64823 "2016-09-28T13:20:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![itlr](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/itlr/32/97646_2.png) [@itlr](https://forum.ionicframework.com/u/itlr)\
**Post date:** [September 28, 2016, 1:20pm UTC](https://forum.ionicframework.com/t/reference-app-component/64823/1 "2016-09-28T13:20:38Z")

</div>

I’m try to get the reference to the App Component

```auto
import { App } from 'ionic-angular'; 

class AnotherComponent {
  constructor (private app: App) {
    
  }

  doStuff () {
    this.app.appRoot.someMethodDefinedInMyAppComponent()
  }
}

```

someMethodDefinedInMyAppComponent() doesn’t seem to be available according to my editor’s intelli-sense.

How can I get the reference to MyApp component?

---

<div class="post-metadata">

**Author:** ![itlr](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/itlr/32/97646_2.png) [@itlr](https://forum.ionicframework.com/u/itlr)\
**Post date:** [September 28, 2016, 5:17pm UTC](https://forum.ionicframework.com/t/reference-app-component/64823/2 "2016-09-28T17:17:03Z")

</div>

What I do now

```auto
in MyApp component

ngOnInit() {
  window['appComponent'] = this;
}

foo() { ... }

in the other component

foo() {
  window['appComponent'].bar();
}

```
