Gbuomprisco / ngx-chips

Tag Input component for Angular
MIT License
903 stars 359 forks source link

More of a proposal than an issue. #928

Open s-dashboard opened 4 years ago

s-dashboard commented 4 years ago

I was checking the documentation and a little on the source code for the ngx-chips, I currently use it in a project.

I know that I can use the ng-template with something like this for the "dropdown" items:

<ng-template let-item>
{{ item.property1 }} {{ item.property2 }}
</ng-template>

But the tag-input fields @Input displayBy, only accepts string for the propertyname in a object. I was wondering if there could be possiblity to use some king of templatestuff in the displayBy, So if the tag-object that shall be visible can be more customized with like:

<tag-input [displayTpl]="tpl">
...
</tag-input> 
<ng-template #tpl  let-tag>
   {{ tag.propertyName1 }}, {{ tag.propertyName2 }}
</ng-template>