1
我在找Angular不更新模型,直到用户提交表格。或者,换句话说,当用户提交表单时,仅更新型号的。如何在Angular提交表单之前不更新模型?
<form ng-submit="process()">
Value is : {{ model.property }}
<input type="text" ng-model="model.property">
<button type="submit">Submit</button>
</form>
我在想像ng-model-options="{ updateOn: null }"
这样的东西,但它不起作用。
这甚至可能没有得到太“hacky”(如获取提交每个输入的值)?
看看http://stackoverflow.com/questions/18240168/genuinely-stop-a-element-from-binding-unbind-an-element-angularjs – vitr
有一个阴影模型。 OnSubmit将表单模型复制到真实模型 – Michael