Trying to pass values by method(function) from one component to another component using extends. But not working. Is it possible by any service?. So How to resolve this issue? If anyone knows please help to find the solutions.
bus.component.ts:
export class BusComponent extends CarComponent implements OnInit {
constructor() {
super();
this.getValues('2', '5');
}
ngOnInit() {}
}
car.component.ts:
export class CarComponent implements OnInit {
constructor() {}
ngOnInit() {}
getValues(a: any, b: any) {
console.log(a + '===' + b);
}
}
Demo : https://stackblitz.com/edit/angular-ivy-mb9wjg?file=src%2Fapp%2Fcar%2Fcar.component.ts