Angular 4 Tutorial - Model Driven Forms #10

preview_player
Показать описание

Angular 4 forms can be implemented using two ways. Template driven and model driven. I will show you how to work with forms in angular 4 using model driven approach.

Angular 4 Template Driven Forms:

Want to learn Angular JS 1?

Join facebook group:
Рекомендации по теме
Комментарии
Автор

simple and awesome explanation!!! i was really confused why there were 2 form types. now i understand after watching your videos

PavanKumar-vumm
Автор

0:00 Showing the app from the last video again

01:03 Model driven forms are more powerful and more flexible (change events, two way data binding)

01:30 ReactiveFormsModule instead of FormsModule

02:14 Import FormGroup and FormControl libraries from @angular/forms in components ts file

03:16 use FormControl to define a ngOnInit function that is called when form elements are initialized (he later changes "new FormControl" to "new FormGroup"!)

06:18 Add the formControlName attribute to each input element of the form

07:46 Add the formGroup attribute to the form element

08:45 Run the App -> Here he spots the FormGroup/FormControl mistake from above

09:17 Run and explain the app again

-andymel
Автор

How to set up checkboxlist(not single checkbox, the checkboxlist is populated from list) and validations in model driven forms?

BigBoss-hjwx
Автор

Hi Awais mirza. I created a model driven form. In that i have a date field. Angular automatically changes that to yyyy-mm-dd date format. How is it happening. please explain.

vijaycenation
Автор

compiler.js:485 Uncaught Error: Template parse errors:
Can't bind to 'FormGroup' since it isn't a known property of 'form'. ("<form [ERROR ->][FormGroup] = 'forms' (ngSubmit) = "onSubmit(forms.value)">


I USED YOUR CODE AND I am getting above error

prashantagrawal
Автор

two way binding is possible in template driven form??

zakariyapindhariya
Автор

do you have all these code at github ?

mehdirazajaffri
Автор

Can't bind to 'FormGroup' since it isn't a known property of 'form'.

charlesfinni
Автор

he needs to fix the order of explanation in this video.

sharjeeltahir
Автор

"can not find name 'ngOnInit' " i got this error when i type function ngOnInit(){}

dicksoniluckasimathayo