My chosen front-end framework is Angular, and below is an example of how I structure my view:
<div class="col-sm-6" ng-repeat="contact in service.contacts">
<label class="control-label mb10">{{contact.textDescription | decodeURIComponent}}</label>
<select multiple="multiple" selectize>
<option>{{contact.value}}</option>
</select>
</div>
I am facing a specific issue that I'm struggling to resolve. When it comes to the contact.textDescription field, I only want unique values to be displayed. If a duplicate textDescription is encountered, I do not want to create a new field. Instead, I want to simply add the contact.value to the options of the existing textDescription entry. Here's an idea of what I am trying to achieve:
if(contact.textDescription is duplicate) {
contact.value.addTo(contact.textDescription which already exists)
}
I am considering applying a filter to address this problem. Any suggestions on how to approach this?