I am facing a challenge with two components named ComponentA and ComponentB. In ComponentB, there is a link that, when clicked, should navigate to ComponentA and send specific data to it. This data needs to be displayed in the dropdown options of ComponentA.
Here is the code snippet from ComponentB:
this.router.navigate(['/component-a'], {
queryParams: {
_series: obj.name1,
_accyName: this.name2,
_accyNum: this.name3
}
});
The HTML code for Component A:
<ss-multiselect-dropdown name="modelYear" id="modelYear" [(ngModel)]="this.modelYear" [texts]="selectTextSettings"
[settings]="multiSelectSettings" [options]="modelYearOptions"></ss-multiselect-dropdown>
The TypeScript code for Component A component.ts (inside ngOnInit):
this.modelYear.push(this.dataFromComponentB.modelYear)
Although I am able to navigate and retrieve values from ComponentB, I am struggling to set these values in the dropdown options of ComponentA. Any suggestions on how to accomplish this would be appreciated.