608 questions
2
votes
2
answers
76
views
Unable to show/get date values from formarray.controls
I am developing a timesheet form page in Angular 20.
I am using formGroup, FormArray and FormControl classes.
I am facing issues in retrieving and displaying the date values which I am pushing into ...
1
vote
1
answer
76
views
How to add item below the current item through button click of Angular Formarray
Like it says, I want to add an item to the middle of a FormArray. So, I have a FormArray and every FormArray item has a button to add a new FormArray item. However, it currently always adds it to ...
0
votes
2
answers
169
views
Accessing Angular Typed Form Property from a FormArray in the HTML Template
I’m working on a form that manages currencies, with fields for code and label. I’m using the latest Angular features and trying to leverage typed forms.
I have a FormArray inside a FormGroup, which is ...
2
votes
3
answers
1k
views
Cannot find control with path error after migrating to Angular 15
The migration from Angular 10 to Angular 15 has caused the following error on the console:
ERROR Error: Cannot find control with path: 'mappedHeaders -> 0 ->
value'
example.ts
headerArray: ...
1
vote
1
answer
144
views
Validator in nested FormGroup of FormArray does not work
I have an easy setup with Angular typed forms.
In the example I built a FormGroup with two FormControls:
A normal text field with required Validators
A form Array that contains a FormGroup with a ...
2
votes
1
answer
90
views
Angular Reactive Form - ng-select in form array works remotely but fails when it's online
What I expect to achieve is selecting a product that comes with a price, adding the quantity, and then selecting another product still from that same list of products. The challenge is this works as ...
6
votes
2
answers
5k
views
How to correctly use types with FormArray in Angular
How should I declare this type ?
Let say I've a FormGroup
I instantize it in the constructor.
export interface MyType {
myValue: string
}
myForm: FormGroup
myArray: FormArray // <FormControl<...
0
votes
2
answers
541
views
Angular - Cannot get ErrorStateMatcher to work with FormGroup inside a FormArray
This works on a simple form, with a single start and end date, but now the form I have is dynamic which has multiple pairs of start and end dates, so I've had to use a FormArray.
Here is the structure,...
1
vote
1
answer
524
views
How to use cdkDropList with Angular FormArray and FormGroup?
I am trying to use a FormArray in combination with a cdkDropList. But as soon as I add the corresponding FormGroup, the cdkDrag within that group stops working. So do any other events, like click ...
51
votes
3
answers
89k
views
Angular Reactive Forms with nested Form Arrays
I'm new to Angular 2 and decided the best way to learn would be to go through the official Angular guides.
I went through the Reactive Forms Guide
https://angular.io/guide/reactive-forms
demo link: ...
0
votes
1
answer
583
views
Angular 17 - Error when creating reactive dynamic form array with child component
I'm trying to create a dynamic form array in Angular 17 with a child component handling part of the input. However, I'm encountering an error:
Type 'AbstractControl<any, any>' is missing the ...
0
votes
2
answers
454
views
Error Populating FormArray using FormGroup in a for loop: Angular 17
I am getting the following error when trying to populate a FormArray in Angular (version 17):
Argument of type 'FormGroup<{ name: FormControl<string | null>; amount: FormControl<number | ...
1
vote
1
answer
948
views
Error on creating dynamic form in Angular 17
I want to create a dynamic form that is an array of payments, the user can add a new payment, delete from the array, and edit.
My HTML:
<form [formGroup]="createLoanPaymentsForm" (...
1
vote
2
answers
58
views
HTML iteration of nested formArrays
Is it posible to have a formArray nested inside of other formArray and show it properly in the HTML view?
I'm building a paginated form based on an API response, so I'm iterating over my response to ...
0
votes
1
answer
290
views
Showing items in Form Array
I need to show users' names and a list of their courses. Different users have different numbers of courses. Thus, I am trying Angular Form Array.
Here is my .ts:
this.form = this.fb.group({
name: [''...
4
votes
2
answers
2k
views
Angular removeAt always remove last element from FormArray
I have following form. arr is a list of FormBuilder.
get arr() {
return this.form.get('arr') as FormArray;
}
this.form = this.fb.group({
id: this.fb.control(''),
name: this.fb....
4
votes
1
answer
5k
views
How to update reactive form field value when other field value changes
I have below reactive form where I'm using form builder with group.
Fig:
Here is the HTML code of the component
<div class="">
<form [formGroup]="FeedBack" (...
5
votes
3
answers
24k
views
How to set values in formarray
I have a form array that is dynamically set after getting data from a service with initial values being false.
constructor(){
this.form = this.fb.group({
//...other controls...
...
1
vote
1
answer
2k
views
push is not a function, received on an Angular FormArray
I'm following a YouTube video to learn Angular (this one, around 2h 52m).
These courses are 4 years old (2018), and I'm attempting to apply them on an Angular 12.
Currently I have to add some controls ...
-1
votes
1
answer
861
views
Angular nested FormArray Cannot find control with name: '0-1'
I am pretty new to angular and learning formArray. I have 2 simple lists of roles and rights. For this, I need to plot a checkbox matrix as follows. Also, at the bottom of every column, I need to show ...
0
votes
1
answer
143
views
Unable to edit input fields when using formGroupName
This is how I set my form control:
formMain = this.fb.group({
details: this.fb.array([
new FormGroup({
label: new FormControl(''),
description: new FormControl(''),
})
])
});
...
0
votes
1
answer
159
views
How to get data from FormArray in Angular
I want to define a question which has some answers. Here is my code:
formGroup!:FormGroup;
answerFormGroup:FormGroup=this.formBuilder.group({
text: ['d', Validators.required],
value: [0, ...
2
votes
1
answer
96
views
How to create nested dynamic form elements
I want the select-option and input-text fields to be added once when I click on the Add button.
I've already achieved this. That's okay.
When I click on the Add Serv button, the input-text field in ...
0
votes
1
answer
3k
views
Angular Reactive Form - Render control in form array for a string array
I have a string array of emails as below:
{
"streetName": "street 1",
"emails" : [
"[email protected]",
"[email protected]"
...
1
vote
2
answers
574
views
Reactive Forms | FormArray Runtime Control Issue | Angular 15
I am new to angular. I wrote one code to dynamically add controls and delete controls using delete button. It is working fine.
But at runtime I am able to input only one character in the controls that ...