I have a multiselect component:
<p-multiSelect class="multiple-select" display="chip" [options]="allTags" name="selectedTags" [(ngModel)]="selectedTags" optionLabel="tag" optionValue="tag"></p-multiSelect>
A single tag in the allTags array:
{ tag: 'someTag' }
And the selectedTags array contains strings. when adding tags, it works perfectly. The issue arises when I want to preselect some tags.
preselectTags(tags: string[]) {
tags.map(x => this.selectedTags.push(x));
}
Ive tried forEach, and plain re assigning instead of array.map but every time I see something like this:
Console.logging the selectedTags after filling it returns an array of correct strings. what am i doing wrong?
PS. thanks for advance.
