vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

Support for editiable-click links inside form #385

Open HugCoder opened 8 years ago

HugCoder commented 8 years ago

I want the validation that a form tag provides, but I also want every single e.g. editable-text element to still be clickable and editable, without having editable-form and having to call myForm.$show(). In my case I have my elements in a table and I started using editable row implementation, but since the boxes take up a lot of room, they also make the table look really bad, compared to having only the element you want to edit show up. So, I went for click-to-edit approach, which meant having to abandon the form tag.

I tried a few things I came up with, including trying to use ng-form instead of form, but it still wants editable-form directive and inside a form tag the editable-texts etc. turn into normal spans or what ever until myForm.$show() is called.

Anyone got an idea of how to keep elements clickable inside a form?

Implementing validation without a form tag is quite a pain, even if it's possible and I have done some of it. Detecting e.g. if a input is dirty/changed would require use of ng-change instead of just detecting if the form element is $prestine or $dirty. Same with $errors. All of it only works inside of form tag.

dnauck commented 8 years ago

It's also related to #6