I'm looking for a way to exchange data between two sibling components effectively.
- Component 1: Component 1 serves as my navigation bar and includes an option to change the language of the app (using ngx-translate). This language selection is presented through a dropdown menu with various options.
- Component 2: On the other hand, Component 2 functions as a blog featuring multiple posts. These posts are stored in a MySQL database, with each post corresponding to one of two possible languages. The posts are segregated into different tables within the database based on their respective languages.
Our objective here is to trigger an HTTP request to the backend when the language selection changes within Component 1. This request should include the currently selected language so that we can retrieve the relevant posts from the appropriate table in the database.
Does anyone have any insights or suggestions on how to capture the selected language in Component 2 whenever the language dropdown in Component 1 is modified?