Whenever I try to call a method from another Component in the Angular, it returns me an error. Below is my TypeScript code:
Component1:
metodoAlertar() {
console.log('bls')
}
Component2:
cpmn: Component1Component;
constructor() {
}
ngOnInit() {
this.cpmn.metodoAlertar();
}
I want whenever my Component2 injects, it calls the present method in Component2 that creates a console.log but it is returning me this following error: