Model binding in angular template driven forms

preview_player
Показать описание
In this video we will discuss
1. Binding Angular form to our own model class
2. We will also discuss, how to fix one of the common error that we get when exporting ngModel into a local variable. The error that we get is, cannot assign to a reference or variable.

Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.

Text version of the video

Slides

Angular CRUD Tutorial

Angular CRUD Tutorial Text Articles & Slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic
Рекомендации по теме
Комментарии
Автор

Why do you pass employee to saveEmployee() method in template, if you have it available in class by using this.employee?

tender.branson
Автор

Why not employee: Employee = new Employee() instead of employee: Employee = { ... }? The more properties you have in class, the more lines of code you should manually type with these null values. It's better to just use new Employee(). One thing to keep in mind is that all the properties will be initialized as undefined instead of null. To fix this you need to specify default value for each property of class, which you don't want to be undefined.

tender.branson
Автор

I am trying to implement this form using reactive forms... however I dont know how to implement the image preview part. how should I bind it to formcontrols in reactive form?

thunderhawknikhil
Автор

How did you initialize a property that is declared as number in the model class?
When I am trying to do that, it is showing error message showing "can not assign null to a property declared as number"

mdjannatussaiyem
Автор

thank you, you earned my subscription :D

johnparungao
Автор

Hello sir iam getting this error
Cannot assign value "$event" to template variable "Name". Template variables are read-only.

I referred ur approach still its not working plz help

snehalshinde
Автор

how do u load form values from the database back into the employee form for updating so that on submitting, only change values are updated and un changed values remail the same. ? If you can do AHORT VIDEO ON THE METHORD USED TO DISPLAY ALREADY CAPTURED DATA BACK IN THE INPUT fields. that would be great.

buddybudz
Автор

Hi, I am getting like this for all the fields and I am trying in angular 9.error TS2339: Property 'fullName' does not exist on type 'CreateEmployeeeComponent'.

11 [(ngModel)]="fullName">,

ritanjalipradhan
Автор

Angular CRUD operations slides after 16 not match to each other..for beginners it's very diffcult to check this code one by one

rohinibakare