💥 Angular Form Array - Step by Step Example

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ม.ค. 2025

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

  • @hamzahbanday8956
    @hamzahbanday8956 2 ปีที่แล้ว

    FINALLYYYY!!!!! Thanks a ton!!!

  • @youtubevanged9359
    @youtubevanged9359 2 ปีที่แล้ว

    Loved it. Thank!

  • @giorgimindiashvili3810
    @giorgimindiashvili3810 ปีที่แล้ว

    perfect thank u so much sir

  • @mantashaali8945
    @mantashaali8945 3 ปีที่แล้ว +2

    Can you help us to know if I want to update the value of formArray , how would I implement that??I followed your code for add and remove. Looking forward for a reply.

    • @ahohm
      @ahohm 3 ปีที่แล้ว

      do you find the way to do update plz??

    • @artreal5440
      @artreal5440 2 ปีที่แล้ว

      @@ahohm Hey, did you found out how to solve it?

  • @venkateshpensalwar6109
    @venkateshpensalwar6109 2 ปีที่แล้ว +1

    [formGroup]="lessonForm" inside the formarray not working

    • @khaledmohamed5282
      @khaledmohamed5282 2 ปีที่แล้ว

      don't name the form group with same name of variable of ng for
      change it and it will be work but define the new name as a form group in TS file cause the restrict mood

    • @Feefor
      @Feefor ปีที่แล้ว +1

      I passed the index as i into the ngFor loop and used [formGroupName]="I">

  • @ruslanpascoal9247
    @ruslanpascoal9247 3 ปีที่แล้ว

    you're the best

  • @medoabdelhameed
    @medoabdelhameed 2 ปีที่แล้ว

    excellent

  • @anshulsahu1220
    @anshulsahu1220 2 ปีที่แล้ว

    Can you help me to update some value which is already in array and also adding a new field in the same component.

    • @artreal5440
      @artreal5440 2 ปีที่แล้ว

      Hey, did you found out how to solve it?

    • @khaledmohamed5282
      @khaledmohamed5282 2 ปีที่แล้ว

      @@artreal5440 i think we will use setValue() and getRowValue() i will try it and back to you

    • @gionazd2127
      @gionazd2127 2 ปีที่แล้ว

      You get the reference to the row, from there u access the form group by position on the formArray and then u upload the form control that you need

  • @yardenshnaider7386
    @yardenshnaider7386 2 ปีที่แล้ว

    can you send css file please?

  • @matthewogunmola7615
    @matthewogunmola7615 3 ปีที่แล้ว

    what if i do not want to have add button to trigger the creation for form controls..What if I want to generate the formArray via an array from API? like pplArr = ['person1', 'person2, 'person3']. I want two text fields created for each person if the array length of pplArr is greater than zero.Does anyone have an ideal? I would not be using a click button. So how do i push to the lessons formArray?

    • @ivanl.sanchezt.1448
      @ivanl.sanchezt.1448 2 ปีที่แล้ว +1

      with a foreach you can call the function add for n values onthe array

    • @gionazd2127
      @gionazd2127 2 ปีที่แล้ว

      Use rxjs map operator