I am trying to pass a value from one component to another in Angular2. So for example, I am trying to implement a component and set a data and title in that component and pass that data and title to another component which is embedded in it?
Here is the code to better explain.
<cst-multiselect [title]="Countries" [data] = ['one', 'two', three']></cst-multiselect>
I am trying to pass the values 'title' and 'data' to another component:
<div ngbDropdown class="d-inline-block" [autoClose]="false"> <button class="btn btn-outline-primary" id="dropdownMenu1" ngbDropdownToggle>Selected Countries </button> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <cst-checkbox></cst-checkbox> </div> </div>
I would like to display the data I passed from cst-multiselect on cst-checkbox(which is a dropdownbox). I would like to set the value and also the data in this dropdownbox. Any help would really be appreciated as I have been trying out multiple methods but to no avail. Thank you!