我有这样的表格
<form name="job" ng-submit="createJob(job,job_)" novalidate>
<!-- some other code -->
<!-- add new requirement to job_.requirement array on-enter -->
<input type="text" class="form-control" ng-model="requirement" ui-keypress="{13:'addRequirement(job_)'}">
<!-- display requirements -->
<ul>
<li ng-repeat="requirement in job_.requirement track by $index" >{{requirement.name}}</li>
</ul>
<!-- submit entire form -->
<button type="submit">Create Job</button>
</form>
因为每当我输入新要求时,都会使用ui-keypress
(在按键上添加新要求=> 13)提交表单。ng-sumbit
我有什么方法可以摆脱它?
创建了一个演示小提琴