like the title says, I'm attempting to make an attribute directive that wraps its parent and allows me to toggle between editing and showing the actual model value..
In short:
<input ng-model="model" allow-edit="editing" />
Would end up looking like:
<div>
<div ng-hide="editing">{{model}}</div>
<input ng-show="editing" ng-model="model"></input>
</div>
If everything went right.
However, I keep on getting something more along the lines of:
<input ng-model="model">
<!-- html from allow-edit directive's template --!>
</input>
I've used input as an example here, but I'd like to be able to wrap arbitrary content (select, etc) as well...
Has anyone been able to make a directive that wraps other content on the same element? Is there a better way to do this that I'm not considering?
Thanks for your help!