I try to answer my own question (in hope it's of use for anyone who stumbles upon the same problem):
After reading parts of the source code, I think it is not possible to do this. I guess the whole point of having a controller is to transform the data into a format that is easy to display (i.e. in a way that x-editable
can directly access it).
Angular x-editable using setter instead of model field
-
05-08-2022 - |
Question
In my angular controller, my model does not exactly reflect the way the data is displayed on the screen. To display the data anyway, I use a method bound to $scope
to extract the data to show.
<a href='#' editable-text="???" onaftersave='setData($data)'>
{{ getData() }}
</a>
Showing the data works fine, but saving doesn't. Lacking an alternative, I used onaftersave
to save the data. However, it seems that one needs to specify editable-text
in order to get x-editable to work. Is there anything else I can do?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow