0

I have this model:

"PRIORITY": [{
            "id": 651,
            "label": "Haute",
            "colorCode": "#ff001e",
            "active": true
        },
        {
            "id": 652,
            "label": "Moyenne",
            "colorCode": "#ffbe33",
            "active": true
        }];

And I must show for every option a small square before label value with background-color: colorCode.

In view, I have this:

<select 
    class="full-width" 
    ng-model="dossier.priorityId" 
    ng-options="item.id as item.label for item in reference.PRIORITY"
    ng-disabled="dossier.statut !== 'EN_COURS_CREATION'" 
    epf-options-class>
    <option value=""></option>
</select>

It's possible to do this in angular 1?

Thanks!

anoop
  • 3,812
  • 2
  • 16
  • 28
Carnaru Valentin
  • 1,690
  • 17
  • 27

1 Answers1

1

Not possible with options. You have to use custom directive or try this one, It is simple you just have to modify its template and directive.

Ghazanfar Khan
  • 3,648
  • 8
  • 44
  • 89