I've been hard at work on an app that allows users to edit items, with those changes updating in a database. To prevent empty form submissions, I automatically fill the input fields with the current item's information.
form.form-update(method="post", ng-repeat='item in items', autocomplete="off" ng-submit='edit()')
.form-group
label(for='key') Key:
input.form-control(type="text" id="key" ng-init="key.updateKey='{{item.key}}' " value='{{item.key}}' name='keyUpdate' ng-model='key.updateKey')`
.form-group
button.btn.btn-primary(type="submit") Save
a.btn(href='/') Cancel`
However, submitting an empty form now results in saving '{{item.key}}' in the Database instead of retaining the old data.