jusopi
jusopi

Reputation: 6813

AngularJS: Non-destructive, non-blocking form submission

problem

Assume I have a form with multiple inputs that bind to various properties of a view's data object. As I tab out ('blur') I want to persist that value to a save service and move on to the next field to edit. This save service returns the newly saved object in full. If I then write the updated object to the controller's data object, the current input that I am editing will lose changes.

question

Is there an built-in Angular solution using ngFormController that I am missing? Are there any libraries that support this without having a per-input type scenario?

I'm really hoping to avoid doing something like:

<input name="field1" save-on-blur="vc.save('field1')">

...and then having to diff the current view model against the incoming view model.

Upvotes: 0

Views: 118

Answers (0)

Related Questions