Angular 9 Tutorial For Beginners #45- Reactive Forms - Validations

  Рет қаралды 26,926

ARCTutorials

ARCTutorials

Күн бұрын

Angular 9 Tutorial For Beginners #45 - Validations in Reactive Forms In Angular, Angular Tutorials Validations in Reactive Forms In Angular, Angular Validations in Reactive Forms In Angular, Angular 9 Validations in Reactive Forms In Angular, Angular tutorial learn Validations in Reactive Forms In Angular, angular 9 Validations in Reactive Forms In Angular, angular Validations in Reactive Forms In Angular 6,7,8, 9, angular 8 example,
Angular 9 tutorial for beginners, angular 9 crash course, angular 9 tutorial for beginners step by step, angular tutorial for beginners 2020, angular tutorial 2020, arc tutorial angular, angular code examples, angular for freshers, angular tutorial for experienced, angular introduction, angular version history, angular full tutorial series, best angular tutorial.
Install bootstrap angular tutorial, Learn how to install Bootstrap in Angular 9 app. In this course you will learn how to create small, medium, large applications with Angular 9 in this development tutorial.
Angular 9 Full Tutorial Playlist
• Angular 9 Tutorial For...

Пікірлер
@sreenuksr
@sreenuksr 4 жыл бұрын
Angular 9 Tutorial For Beginners #45- Reactive Forms - Validations - Validations are an extremely important and integral part of any forms in apps - we use validations to prevent unwanted data or junk data - angular provides common validators like milLength, maxLength, required etc... - Angular maintains state information of the forms all the times - ng-touched, ng-untouched, ng-dirty, ng-pristine, ng-valid, ng-invalid - 3 Ways to perform validations in Angular reactive forms - Highlighting the errors - Disabling Submit button - Custom Field Level Validations - Import Validators into component file checkout.component.html Checkout Form - Using Reactive Forms Email Enter email Address Enter Valid email Address Quantity Enter Quantity Minmum Length Not Matched Checkbox Agree to Terms & Conditions Checkout checkout.component.ts import { Component, OnInit } from '@angular/core'; import { FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms'; @Component({ selector: 'app-checkout', templateUrl: './checkout.component.html', styleUrls: ['./checkout.component.scss'] }) export class CheckoutComponent implements OnInit { // checkoutform: FormGroup; // constructor(private formBuilder: FormBuilder) { // this.checkoutform = formBuilder.group( // { // emailFld: new FormControl(), // qtyFld: new FormControl(), // trmChk: new FormControl() // } // ) // } checkoutform: FormGroup; constructor(private formBuilder: FormBuilder) { this.checkoutform = formBuilder.group( { emailFld: ['',[Validators.required,Validators.email]], qtyFld: ['',[Validators.required,Validators.minLength(5)]], trmChk: ['',Validators.requiredTrue] } ) } ngOnInit(): void { } postdata() { console.log(`Email Address: ` + this.checkoutform.value.emailFld); console.log(`Quantity: ` + this.checkoutform.value.qtyFld); console.log(`IsTermsChecked: ` + this.checkoutform.value.trmChk); } }
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Thanks for sharing the compilations. Regards Sridhar
@amanuellebassi7294
@amanuellebassi7294 4 жыл бұрын
I don't have words. I am enjoying Angular. You made me love the course. You are second to none! Keep up the good work.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
So glad to hear that you are enjoying 👍
@jacksm8709
@jacksm8709 4 жыл бұрын
best of the best... am still following u and I av created my first web system just by following ur examples.. be blessed and thank you.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Wow..awesome!!! Comments like these makes me so much happy and encourages me to bring even better content and tutorials for you. Thank you so much again Jacks. Regards Sridhar
@rahulpathak906
@rahulpathak906 4 жыл бұрын
man outstanding and All your tut are amazing and wonderfull ..After waching the concept now i am very confident for Angular intriview else it was nightmare to work on project s without knowing concept no one can . thanks for the knowlege hub series and all hardwork ....
@ARCTutorials
@ARCTutorials 4 жыл бұрын
I cannot tell you how happy i feel after seeing your encouraging words and comments. I will try to always give you the best tutorials 👍👍
@amritachourasiya6720
@amritachourasiya6720 2 жыл бұрын
best of best so far
@ARCTutorials
@ARCTutorials 2 жыл бұрын
Thanks Amrita for your kind words
@Hgayashan
@Hgayashan 4 жыл бұрын
One of the best angular tutorials available on youTube.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Glad it was helpful!
@kasperkat2004
@kasperkat2004 4 жыл бұрын
Thank you so much! Your course and method of teaching are excellent!!
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Thanks Kasper 👍
@igorr4682
@igorr4682 2 жыл бұрын
it's worth mentioning that if you have more than one validator, the list of validators is array itself. For beginners it's easy to miss that.
@robingusain6284
@robingusain6284 2 жыл бұрын
really ;great stuff
@iamhassell
@iamhassell 2 жыл бұрын
Another great tutorial - thank you!
@ARCTutorials
@ARCTutorials 2 жыл бұрын
You're very welcome!
@anuragsinha6135
@anuragsinha6135 3 жыл бұрын
Lots of love Arc Tutorial 😀
@ARCTutorials
@ARCTutorials 3 жыл бұрын
Hi Anurag. Do check out the Angular 10 series as well - with new examples and use cases kzbin.info/www/bejne/fJiXpKOIa8iXeLM
@sonnysonny66
@sonnysonny66 4 жыл бұрын
Hi sir. do i need to do a reactive form validation and also a rest API validation? or only reactive form validation will do? A respond is greatly appreciated.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
We should always do validations in both sides. Both in Frontend and in backend APIs
@sonnysonny66
@sonnysonny66 4 жыл бұрын
@@ARCTutorials thank you sir. really liking your videos
@ritikchoudhary2433
@ritikchoudhary2433 4 жыл бұрын
Hello sir, Could You tell us about what should be the approach to build an Angular Project example- Admin Dashboard, etc.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Ritik. I am currently doing Angular CRUD Tutorial series where we are building a project from scratch. Please the tutorial series and I am sure you will learn from scratch how to build apps.
@ritikchoudhary2433
@ritikchoudhary2433 4 жыл бұрын
@@ARCTutorials i m on #44 th tutorial , i ll surely check the crud tutorials Ty for that. I m able to understand the fundamentals very well and pretty sure others will do so😀 Thanks Sir
@kasperkat2004
@kasperkat2004 4 жыл бұрын
A suggestion: in future videos use ctrl b and ctrl ` to free up space on your screen and hide unnecessary items on it.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Thanks buddy. Will do in future tutorials 👍
@pusarlaaishwarya5035
@pusarlaaishwarya5035 4 жыл бұрын
seriously !!!! you made my work easy!!!!thanks a lot!!!!!! if possible make videos on react also
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Aishwarya. Yes React JS videos also coming soon.
@MrFuture-96
@MrFuture-96 4 жыл бұрын
Thank you so much sir for each great video
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Thank you 🙏
@bhanuprakash2974
@bhanuprakash2974 4 жыл бұрын
sir in previous we have used formcontrol that is we have created an object for every field. now we are not using that but we are using validators.required. is the form builder builds those automatically?
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Bhanu. Please follow Angular 10 tutorial series as this will be covered again in detail and you can practice with me along. Please check Angular 10 tutorial series for complete learning kzbin.info/www/bejne/pXayYX6wjpacpsk
@bhanuprakash2974
@bhanuprakash2974 4 жыл бұрын
@@ARCTutorials thank you sir.. i will definitely follow you. And share your videos. But small request. Please have a look on ag grid.
@SaiKumar-tg6ct
@SaiKumar-tg6ct 4 жыл бұрын
Nice explanation, will you explain about Image File upload validation too
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Sai. Yes i will cover it in Angular forms in Angular 10 series. Please follow Angular 10 series. kzbin.info/www/bejne/fJiXpKOIa8iXeLM
@SaiKumar-tg6ct
@SaiKumar-tg6ct 4 жыл бұрын
@@ARCTutorials Ok sure & thank you
@SaiKumar-tg6ct
@SaiKumar-tg6ct 4 жыл бұрын
@@ARCTutorials Ok sure & thank you
@lewiswill3663
@lewiswill3663 4 жыл бұрын
Sir, i have a question. How to allow only checkbox is checked (without radio button). Thanks for this tutorial.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Simple. Make sure the count of a variable is 1 and once its 1 disable all other checkboxes.
@diyaaeddinechaali8208
@diyaaeddinechaali8208 4 жыл бұрын
Amazing ! thanks a million sir
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Glad you liked it!
@xtech5881
@xtech5881 3 жыл бұрын
I am using css part not scss part..and the input.ng-touched.ng-invalid is not working in css component..or hasError also..what will i do for this..i need validation in my project..
@ARCTutorials
@ARCTutorials 3 жыл бұрын
Hi X Tech. Can you pls send me screenshot at soorya.aaradhya@gmail.com
@umadevicrips7888
@umadevicrips7888 4 жыл бұрын
I have one doubt ji why we want to angular html css and js we can use in notepad also particular y we use angular for web development suddenly I got doubt in these... Please explain in detail..
@1balwant
@1balwant 4 жыл бұрын
Nice tutorial! What is error vs hasError?
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Balmat. Please follow Angular 10 tutorial series as this will be covered again in detail and you can practice with me along. Please check Angular 10 tutorial series for complete learning kzbin.info/www/bejne/pXayYX6wjpacpsk
@ashwinideveloper8207
@ashwinideveloper8207 4 жыл бұрын
hi can i check the condition in reactive forms like < and >
@avi8859
@avi8859 3 жыл бұрын
Sir if you replace the formControl( ) by validator then how how data come in formControl????
@ARCTutorials
@ARCTutorials 3 жыл бұрын
Hi Avi. Please follow Angular 10 reactive forms. I have covered a lot of use cases in detail. kzbin.info/www/bejne/iprLgqOKi7F4g8k
@abhishekbagela7973
@abhishekbagela7973 4 жыл бұрын
Can't bind to 'ngIf' since it isn't a known property of 'span'.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi. Can u pls post ur code here pls?
@96FROZEN
@96FROZEN 4 жыл бұрын
Hi I have a small question: The email validator appears to take incomplete addresses such as peter@pan (missing the last part of a domain, like .com, .net etc...). How would one go about validating fields in that style? Thanks
@96FROZEN
@96FROZEN 4 жыл бұрын
Please forget the question, in case someone else was curious about the same thing: Basically emails do not require a top level domain (e.g : .com, .net, .co.uk), these are perfectly valid, however if you want to verify if the email address has a top level domain, you can use the following: apply Validators.pattern("^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$")]). If you're not familiar with this, this is regex (short for [reg]ular [ex]pression), it's quite common to use it as a way to validate if input is according to what you're expecting.
@ARCTutorials
@ARCTutorials 4 жыл бұрын
We have had another user ask a similar question. Glad you shared your knowledge. Thanks Pedro. Cheers. Happy Learning
@ashwini6804
@ashwini6804 4 жыл бұрын
how many tutorials i learned to get clarity on angular???
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Are you not getting clarity or facing problems in learning Angular in my series?
@ashwini6804
@ashwini6804 4 жыл бұрын
Getting clarity ..and how videos out of 97 to get some knowledge on that
@ashwini6804
@ashwini6804 4 жыл бұрын
Sorry how many
@ARCTutorials
@ARCTutorials 4 жыл бұрын
@@ashwini6804 if yo ucover around 70 tutorials you would master Angular. Remaining 20 are project work
@vivekrampelly6435
@vivekrampelly6435 4 жыл бұрын
i am watching each and every class of your tutorial is completly awesome .can you please share the notes sir
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi vivek. Can u pls send email at soorya.aaradhya@gmail.com
@jacksm8709
@jacksm8709 4 жыл бұрын
just a by the way,am getting this error on my web console." core.js:6228 ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays." where should I look?
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Jacks. Most probably you are binding data which is an Object. Instead use like this object.name where name is the key in the object.
@jacksm8709
@jacksm8709 4 жыл бұрын
will check thanks for the reply@@ARCTutorials
@jacksm8709
@jacksm8709 4 жыл бұрын
i av 2 questions 1. I have two input boxes and I want both to have the same data enter e.g password and confirm password boxes. how can I validate data on the form without leaving the form? 2. if I want my form to have more than two buttons e.g update and delete buttons and the has a submit().
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Jacks. We can do a (blur) method on both form controls and then check if the values are same if yes, proceed. If not, show validation error. Try it out else I will try and create a quick fix tutorial
@jacksm8709
@jacksm8709 4 жыл бұрын
i tried this and it works but the form is still valid Please Enter Password
@anandparmar5068
@anandparmar5068 4 жыл бұрын
Good morning sir
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Anand. Had some issues with internet connection. Sorry for late reply
@subhashmunnaluri
@subhashmunnaluri 3 жыл бұрын
i have been getting error near hasError after compling. any solution
@subhashmunnaluri
@subhashmunnaluri 3 жыл бұрын
it shows object is null
@ARCTutorials
@ARCTutorials 3 жыл бұрын
Hi Subhash. Please send me code snippet and error screenshot at soorya.aaradhya@gmail.com
@subhashmunnaluri
@subhashmunnaluri 3 жыл бұрын
@@ARCTutorials thanks for replying. I have found the solution. Thanks for your time.
@harshit9900
@harshit9900 4 жыл бұрын
Sir in browser html page is running but cant apply validation in that even it show no error
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Harshit. Please follow Angular 10 tutorial series as this will be covered again in detail and you can practice with me along. Please check Angular 10 tutorial series for complete learning kzbin.info/www/bejne/pXayYX6wjpacpsk
@shivangijain9181
@shivangijain9181 4 жыл бұрын
Enter email address. It gives error on the conditions : touched and hasError Error says, "Object is possibly null". Can you please solve this?
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Shivangi. Are you following exactly I showed? if yes and still see the error, drop me an email at soorya.aaradhya@gmail.com and i will send you updated code
@Sachin-qk3uo
@Sachin-qk3uo 4 жыл бұрын
getting the same error...did you get the updated code?? if so please send me the updated code
@ashekseum9301
@ashekseum9301 3 жыл бұрын
Use this: Enter Email Address
@jacksm8709
@jacksm8709 4 жыл бұрын
why am i getting this error, tried all sort of things. Cannot read property 'touched' of null my code is Please Enter Other Names its not firing at all..
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi jacks haserror should be small case. U have written it wrong. Pls try correcting it again. Thanks Sridhar
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Check for spelling for the form name and form control name
@jacksm8709
@jacksm8709 4 жыл бұрын
thanks i have checks and truly had misspelled then.. tanks
@jacksm8709
@jacksm8709 4 жыл бұрын
sorry for misspelling and have not splept..
@mithileshpandey9885
@mithileshpandey9885 4 жыл бұрын
i need video for using nested formgroup in reactiveform
@ARCTutorials
@ARCTutorials 4 жыл бұрын
Hi Mithilesh. Please follow Angular 10 tutorial series as this will be covered again in detail and you can practice with me along. Please check Angular 10 tutorial series for complete learning kzbin.info/www/bejne/pXayYX6wjpacpsk
@soulsscience2198
@soulsscience2198 3 жыл бұрын
.hasError() is not working bro is throws error like object like possible null
@muralikrishna8133
@muralikrishna8133 3 жыл бұрын
this is new addition to the latest angular - checkoutForm.controls['emailField'].touched && checkoutForm.controls['emailField'].errors?.required.
@soulsscience2198
@soulsscience2198 3 жыл бұрын
@@muralikrishna8133 got it bro thanku
@mohamedibrahimabdulghani5514
@mohamedibrahimabdulghani5514 2 жыл бұрын
i have error when i use { *ngIf="checkoutform.get('Name').hasError('required') "} can you help me !
Angular 9 Tutorial For Beginners #46- Reactive Forms - Get Values
7:54
Angular 9 Tutorial For Beginners #44- Reactive Forms
24:14
ARCTutorials
Рет қаралды 42 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Custom Validation and Error Code | Reactive Forms | Angular 13+
15:43
💥 Angular Forms CSS State Classes -  (ng-valid ng-touched ng-dirty)
12:49
Angular University
Рет қаралды 4,8 М.
Angular 9 Tutorial For Beginners #42- Template Driven Forms
18:27
ARCTutorials
Рет қаралды 28 М.
Angular Reactive Forms in 10 Minutes
10:45
Thinkster
Рет қаралды 40 М.
How to validate reactive forms in Angular 16?
10:31
AyyazTech
Рет қаралды 3,9 М.
Angular Reactive Forms Validation Example
23:18
coderspirit
Рет қаралды 57 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН