💥 Angular Form Array - Step by Step Example

Поділитися
Вставка
  • Опубліковано 19 лис 2024

КОМЕНТАРІ • 20

  • @giorgimindiashvili3810
    @giorgimindiashvili3810 Рік тому

    perfect thank u so much sir

  • @youtubevanged9359
    @youtubevanged9359 Рік тому

    Loved it. Thank!

  • @hamzahbanday8956
    @hamzahbanday8956 2 роки тому

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

  • @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">

  • @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 2 роки тому

      do you find the way to do update plz??

    • @artreal5440
      @artreal5440 2 роки тому

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

  • @medoabdelhameed
    @medoabdelhameed 2 роки тому

    excellent

  • @ruslanpascoal9247
    @ruslanpascoal9247 3 роки тому

    you're the best

  • @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

  • @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

  • @yardenshnaider7386
    @yardenshnaider7386 2 роки тому

    can you send css file please?