In my Angular 7 application, I have two sibling components - a configurator component and a custom stepper component. The configurator component is responsible for fetching data from the API and performing calculations on it. I would like to display the calculated values in the custom stepper component.
I have created a service called PriceWeightService but I am unsure about which code should be moved where and how to retrieve the values from that service in the custom stepper component.
The configurator.component.ts contains the following code:
//Code from configurator component
//...
The custom-stepper.component.ts
file contains the following code:
// Code from custom-stepper component
// ...
This is the HTML for the custom stepper component where I want to display the values:
// HTML code for displaying values in custom stepper component
// ...
I have included the PriceWeightService in the project with the following code:
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class PriceWeightService {
weight = 0;
}