Reactive Form Validation in Angular: Mastering Best Practices

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 พ.ย. 2024

ความคิดเห็น • 41

  • @MonsterlessonsAcademy
    @MonsterlessonsAcademy  5 หลายเดือนก่อน

    WATCH NEXT: Angular Interview Questions and Answers - Dominate Your Next Interview - th-cam.com/video/5A_YKlVWMPo/w-d-xo.htmlsi=2DCn7yspEAAJ2H6l

  • @RomanWaves
    @RomanWaves 14 วันที่ผ่านมา

    good tutorial thank you! could you also provide the Angular version you are using ? would be nice to know that at the beginning of the tutorials, or did I maybe miss it somewhere?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  13 วันที่ผ่านมา

      You can always check it in the source code under the video

    • @RomanWaves
      @RomanWaves 11 วันที่ผ่านมา

      @@MonsterlessonsAcademy thanks :)

  • @advance5189
    @advance5189 2 หลายเดือนก่อน

    I always find something new for me in your videos. Pretty good work. Thanks!

  • @maximkantsura1219
    @maximkantsura1219 3 หลายเดือนก่อน

    Nice guide, thanks for your work

  • @ugochukwuumerie6378
    @ugochukwuumerie6378 4 หลายเดือนก่อน

    Awesome lesson

  • @dunmer0992
    @dunmer0992 6 หลายเดือนก่อน

    Very nice. It really hit the spot.

  • @oleksiipopov5143
    @oleksiipopov5143 6 หลายเดือนก่อน

    Great lesson!

  • @TeddyEDMOND-p6u
    @TeddyEDMOND-p6u 5 หลายเดือนก่อน

    this is nice, in order to unbloat the file i would suggest creating an error component that takes an the errors and formControls and displays them when ever error happens.
    with the right modularity this could save some massive time and allow you DRY code.
    (this is not the subject i know )

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  5 หลายเดือนก่อน

      Sure. You can split it like you want. I just showed the most simple and basic way, so people understand how it works.

    • @sam.s6686
      @sam.s6686 3 หลายเดือนก่อน

      Hi, can you please refer me to an example on how to do that

    • @TeddyEDMOND-p6u
      @TeddyEDMOND-p6u 3 หลายเดือนก่อน

      ​@@sam.s6686 i didn't really find any example of this online.
      however here is what you can do:
      create a component that takes the error object stored in the form. this components goal is to display the error and a detail of this error so you can write all the needed logic there.
      (i suggest you study the shape of the error object)
      then instead of creating a div with ngif or @if
      simply use an instance of this component for each input of your form.
      when there is an error your component should display the error and why it happened.
      note that angular material can display the common errors of a form out of the box.
      you should also read the document on the angular material inputs.

  • @kanaiyatiwari6748
    @kanaiyatiwari6748 5 หลายเดือนก่อน

    which themes you are using in vscode

  • @Brendan2Alexander
    @Brendan2Alexander 5 หลายเดือนก่อน

    So...do reactive forms work in a zoneless environment?

  • @sohailnaseer7251
    @sohailnaseer7251 4 หลายเดือนก่อน

    @if decorator is not working in angular 15. what is the issue?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  4 หลายเดือนก่อน

      It is not available in angular 15. Use *ngFor directive instead.

  • @TurboSasa
    @TurboSasa 5 หลายเดือนก่อน

    Why not use form field getter in component ts for example
    `get firstName(): AbstractControl {
    return this.form.get('firstName');
    }`
    and then in template `@if (firstName.invalid ...`

  • @fadil2671
    @fadil2671 5 หลายเดือนก่อน

    whats the difference with
    form = new FormGroup({
    name: new FormControl(null, [Validators.required, Validators.minLength(8)])
    desc: new FormControl(null)
    })

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  5 หลายเดือนก่อน +1

      There is no difference. You can provide validators if you need to but it is not mandatory

    • @fadil2671
      @fadil2671 5 หลายเดือนก่อน

      @@MonsterlessonsAcademy okay, nice. thanks

  • @N4suu-t3y
    @N4suu-t3y 5 หลายเดือนก่อน

    what is your fonts

  • @karthim9620
    @karthim9620 5 หลายเดือนก่อน

    I need to connect

  • @fawzzhkz9023
    @fawzzhkz9023 5 หลายเดือนก่อน

    ❤superb

  • @chickenjoy
    @chickenjoy 6 หลายเดือนก่อน

    What if I only want the errors to show when I click outside and not when I'm am still typing so that I will not get distracted or slightly pissed off that I haven't finished typing yet.

  • @deleted-u5g
    @deleted-u5g 6 หลายเดือนก่อน

    A comment for the algorithm

  • @matthewfreedberg3752
    @matthewfreedberg3752 5 หลายเดือนก่อน

    "my speak english very bad. So, my name is Boris. I gotta go home to Albania to work on war factory and build tanks. London is a capital of Great Britain!" Damn, dude, I know it is very important to support all kinds of spreading knowledges, but at first you should work on your English pronunciation and only then play role of youtube blogger. My ears are bleeding right now! And I am still silent about how you look (not event close to Brad Pitt). If it is so necessary to practice English or acting or acting in English, there are so many platforms for it. I don't think that non-public frontend work for IT company brings less income than blogging (but who knows I am not an Angular blogger from USSR). For Christ's sake.