0

Let's say we have two components: Component 1 and component 2. Each component has a text input field. Component 1 has an input field that has a read only value being populated from the backend. Component 2 has an input field where user can enter a numerical value. Let's user enters some value in the input field in component 2. That value has to be added to 200 and the answer needs to be displayed on the input field in component 1. Since I am new to angular, can someone please guide me on this? This must be achieved through reactive forms. The components share a sibling relationship.

https://drive.google.com/file/d/1_PZ5KQHUlquLlPaxMuFYDET8XDmAp-KL/view?usp=sharing

1 Answers1

0

If you Want to Move to Component 1 immediately after you enter data in Component 2 you can pass data through Event Emitters https://angular.io/api/core/EventEmitter Which emit the component with data

or

If you just want to pass data you can use Session Storage How to store token in Local or Session Storage in Angular 2?

  • Thanks much for your response. Can you provide me any working example if you come across so that it will be very helpful to learn it live? – Seeking_Answers Nov 11 '21 at 15:57