docs: add button type in form array example (#43666)

add a button type in the example of creating a dynamic form so that the button that adds the alias control does not submit the entire form

PR Close #43666
This commit is contained in:
little-pinecone 2021-10-01 13:47:01 +02:00 committed by Dylan Hunn
parent 7aea5256de
commit 7cd87ea4c4

View file

@ -27,7 +27,7 @@
<!-- #docregion formarrayname -->
<div formArrayName="aliases">
<h2>Aliases</h2>
<button (click)="addAlias()">+ Add another alias</button>
<button (click)="addAlias()" type="button">+ Add another alias</button>
<div *ngFor="let alias of aliases.controls; let i=index">
<!-- The repeated alias template -->