component1.html
<input type="text" value="some text">
<button>next</button>
anotherComponent.html
<input type="text">//value of component1 should be shown here when the button is clicked.
There are two independent components here.
My question is how to pass value of component1 to anotherComponent when the button is clicked.