Saturday, February 15, 2020

Angular

**** Forms *****

- In angular, we can design the forms.

- In Angular, we can design the forms in 2 ways.

1) TDF (Template Driven Forms)

2) MDF (Model Driven Forms) (MDF) (Reactive Forms)

- Template Driven Forms Mainly Based on View.

- Model Driven Forms mainly based on "Model Data".

- Angular By default apply the following validations on Forms.

1) dirty   ==> pristine   (when ever change detected)

2) touched ==> untouched  (when ever we touch the fields)

3) valid  ==> invalid    (when ever  we ignore the required rule




***** Model Driven Forms *****


- Model Driven Forms also called as Reactive Forms.

- Model Driven Forms mainly on Model.

- [formGroup] is the predefined directive used to assign the logical name to form.

- formControlName is the predefined directive used to declare the form elements.

- formGroupName is the predefined directive used to create the "sub groups".

- Reactive forms available on "ReactiveFormsModule"

- "ReactiveFormsModule" available in "@angular/forms" package.


******************************************
MDFEx
src
    app
app.component.ts
app.conponent.html


app.module.ts
index.html
******************************************


















































No comments:

Post a Comment