Attempting to pass values between components using inheritance but encountering difficulties. Is it possible to achieve this through a service? If so, how can I overcome this issue? Any assistance in finding the solution would be greatly appreciated.
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