Is exportAs property defined for a component. How can I access outside the component to a method of it? I tried this example
<my-app #my="myApp">
loading...
</my-app>
<button (click)="my.displayMessage()" class="ui button">
Display popup for message element
</button>
Here the component class
import {Component} from 'angular2/core'
@Component({
selector: 'my-app',
providers: [],
template: `
<div>
<h2>Hello {{name}}</h2>
</div>
`,
directives: [],
exportAs: "myApp"
})
export class App {
constructor() {
this.name = 'Angular2'
}
displayMessage():void {
console.log('called from component')
}
}