1
私が送信として定義されていないボタンを押すと、submit(formAccessor)ボタンが機能します。送信ボタンとして定義していないため、この動作が不思議です。実際にフォームに別のボタンを追加すると、それも送信されます。フォームにボタンを入れて別の動作を与えるにはどうすればいいですか? thaksどのように角度がボタンが送信ボタンであることを知っていますか
<form #formAccessor="ngForm" on-ngSubmit="submit(formAccessor)">
<div class="form-group">
<label for="id">ID </label>
<input ngModel name="id" id="id" #idAccessor="ngModel" type="text" class="form-control">
</div>
<div class="form-group">
<label for="dataModelVersion">Data Model Version </label>
<input id="dataModelVersion" type="text" class="form-control">
</div>
<div class="form-group">
<label for="orderId">orderId </label>
<input id="orderId" type="text" class="form-control">
</div>
<button class="btn btn-primary pull-right">Submit</button>
</form>
私はタイプ=「提出」 '' https://stackoverflow.com/questions/9643806/form-is-submitted-when-i-click-on-the-にフォームのデフォルト値内のボタンを推測しますbutton-in-form-how-to-avoid-this- –
この動作は角度固有ではありません。 –