Scenario :
- I am using Chips Autocomplete component.
On selecting the particular option from the list it is displaying the selected option as the chip in the input filed as shown in below image.
Todo :
- I want these chips to be displayed outside the input field,
means in any other div.Like below image
How can i do this ?
Here is the stackblitz link.
It is very simple. as you are already using fruits array to add or remove the items, thus you can access fruits array any where in your html file of that component
<h1> *ngFor="let fruit of fruits">{{fruit}} </h1>
Move
<mat-chip>
out of<mat-form-field></mat-form-field>
See here:https://stackblitz.com/edit/angular-h8zdkh-ao3bzb?file=app/chips-autocomplete-example.html
Use simple
auto-complete
to search players and display the selected players aschip-list
inside the outerdiv
as like belowJust move the
input
field outside (top or bottom) of the</mat-chip-list>
and you should be fine.You might want to add some padding/margin after that :)