I have two components like these:
@Component({
selector: 'comp1',
template: `<h1>{{ custom_text }}</h2>`
})
export class Comp1 {
custom_text:string;
constructor(text:string) {
this.custom_text = text;
}
}
/*********************************************/
@Component({
selector: 'comp2',
directives: [Comp1],
template: `
<b>Comp 2</b>
<comp1></comp1>
`
})
export class Comp2 {
constructor() {
// ...
// How to send my own text to comp1 from comp2
// ...
}
}
Is it possible to send my own text from comp1 to comp2?
Is it possible to get the comp1 instance from comp2?