I am currently working on an editable form that can be edited inline.
The directive I'm using passes down the ng-options to the template. Here's how it looks in a jade file:
div(input-inline-select="myobj.val" options="c.name for c in codes" tabindex="1")
Within the directive code:
scope.options = attr.options;
In the template where the select is rendered:
div(class="input_inline_edit_div")
{{options}}
select(class="inline_edit_select" ng-options="{{options}}" ng-model="model" on-enter="save()" on-esc="cancel()" ng-show="editMode" tabindex="{{tabindex}}" ng-focus="edit()")
span(ng-mouseenter="showEdit = true" ng-mouseleave="showEdit = false")
span(ng-hide="editMode" ng-click="edit()" )
div(class="inline_edit_text")
{{model}}
The issue I'm facing is that the initial {{options}}
displays the correct value of c.name for c in codes
, but when used within ng-options="{{options}}"
it does not work, causing the select options to disappear. Any insight into why this might be happening? Why does 'options' expand correctly on its own, but not as an attribute value?