Plunker: Direct Edit example.
In the above plunker, I have a directive (direct-edit) which uses
transclude: 'element',
to surround the element with other markup. The directive
requires: 'ngModel',
to connect the additional markup to the model. However, because the initial element is wrapped up with ng-transclude, it becomes disconnected from the model. Does anyone know how to fix this?
EDIT (from comments below):
To clarify: I want to take any arbitrary directive:
<custom attr1="" attr2="" style="" ng-model="random" />
and add the direct-edit directive so that the arbitrary directive is paired with a field that edits the value directly. For the purposes of simplicity, I'm only showing a text input in the example code.