In Angular 2 how do you access a child component class from the parent component class? e.g.
import {Component, View} from 'angular2/core';
@Component({selector: 'child'})
@View({template: `...`})
class Child {
doSomething() {
console.log('something');
}
}
@Component({selector: 'parent'})
@View({
directives: [Child],
template: `<child></child>`
})
class Parent {
constructor() {
//TODO: call child.doSomething() when the child component is ready
}
}
In this example how would I call the Child component's doSomething() method from either the Parent component's constructor or some callback function.