{% if context == 'angular' %}
<cf-select{{ this.getAttribs(context)|attribs }}{% if this.possibleValues %} ng-options='item.key as item.value for item in {{ this.possibleValues|assoc2array|json_encode }}'{% endif %}>
{% if this.placeholder %}
    <option value="">{{ this.placeholder|raw }}</option>
{% endif %}
</cf-select>
{% else %}
<select{{ this.getAttribs(context)|attribs }}>
{% if this.placeholder %}
    <option value=""{% if this.value is sameas(null) %} selected="selected"{% endif %}>{{ this.placeholder|raw }}</option>
{% endif %}
{% for value, option in this.possibleValues %}
    <option value="{{ value }}"{% if value == this.value and this.value is not sameas(null) %} selected="selected"{% endif %}{% if option.attribs %}{{ option.attribs|attribs }}{% endif %}>{% if option.label %}{{ option.label }}{% else %}{{ option }}{% endif %}</option>
{% endfor %}

</select>
{% endif %}