Mudanças entre as edições de "Disabled input in Angular2"

De Basef
Ir para: navegação, pesquisa
(Criou página com 'Suppose you have a form using Model Driven Form "myForm" and want to validate if the form is valid. The way to do this is use "[disabled]": <source lang="xml"> <form [formGro...')
 
 
Linha 9: Linha 9:
 
Note: the example only shows how to use [disabled]. To have a working example, you have to create a Model Driven Form and configure it with validators.
 
Note: the example only shows how to use [disabled]. To have a working example, you have to create a Model Driven Form and configure it with validators.
  
[[Category:AngularJS2]]
+
[[Category:Angular]]

Edição atual tal como às 09h38min de 27 de janeiro de 2020

Suppose you have a form using Model Driven Form "myForm" and want to validate if the form is valid. The way to do this is use "[disabled]":

<form [formGroup]="myForm">
    <button type="submit" [disabled]="!myForm.valid">Submit</button>
</form>

Note: the example only shows how to use [disabled]. To have a working example, you have to create a Model Driven Form and configure it with validators.