I'm currently working on a directive template that features the following code snippet:
<div class="colorpicker">
<div>Chosen color</div>
<div class="color_swatch" style="background-color: {{ngModel}}"> </div>
<div class="clearfix"></div>
<div>Standard colors</div>
<div class="color_squares">
<div ng-repeat="color in colorList">{{color.trim() == ngModel.trim()}} //does not update
<div class="color_swatch" style="background-color: {{ color }};"></div>
</div>
</div>
<div class="clearfix"></div>
Within the directive, I have implemented the code below to update the ngmodel with the selected color. However, despite debugging the code and confirming that the values are identical, "{{color.trim() == ngModel.trim()}}" always evaluates to false.
{{color.trim() == ngModel.trim()}}
Can you identify what might be missing in my implementation?