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
502
views
How to use PrimeNG Autocomplete with multiple selection in a FormArray?
I'm working on an Angular project where I need to implement a form that includes a FormArray with multiple FormControl instances, each using PrimeNG's Autocomplete component with multiple selection ...
1
vote
1
answer
67
views
Value is undefined in formArray
I have form array and for some reason I dont see any value in my app-input component. if I define simple formGroup contorl and pass to app-input I can see value. But in formarray happnes something ...
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
89
views
<mat-form-field> component doesn't work properly with FormArray and formGroupName
The input field is not displayed with the appearance of <mat-form-field> before clicking inside when formGroupName is used with FormArray.
See the example:
TS:
formMain = this.fb.group({
...
1
vote
1
answer
37
views
How to push collection of formgroup into formArray
I have a form in a steper (cdk) that works fine and I'm refactoring it to make it dynamic. My goal is to use json at the end to generate the form content.
Right now I have the following code:
export ...
2
votes
1
answer
72
views
How to get the value from dynamically added nested form in angular using valueChanges?
I am dynamically adding formControl to a parent form by iterating an array of objects & want to track the change in these dynamically added controls by adding the valueChanges to the parent form ...
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: ...
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
293
views
FormArray with nested FormGroups. How to access the nested form group controls?
I have a FormArray with 3 FormGroups and each form group has 2 controls. Im not sure how to access the controls within the form groups to set the form control name.
setting up the form
this.form = ...
1
vote
1
answer
55
views
Angular array to display value based on another control value
I am working on billing of product page based on product list using Angular as front end.
Here when I selected product "apple" the price should be calculated and displayed in price control ...
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
1
answer
49
views
Angular - ERROR Error: Cannot find control with name: 's..Address'
I have the following component in HTML:
<div>
<form [formGroup]="dynamicFormGroup" (ngSubmit)="onSubmit()">
<div class="form-row" *ngFor="...
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
90
views
Angular FormArray can't bind to my FormControls
Hi i have a component template recipe-edit.component.html:
<div class="row">
<div class="col-xs-12">
<form [formGroup]="recipeForm" (ngSubmit)="...
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, ...
0
votes
1
answer
22
views
Can't get Angular Dynamic Nested FormArrays to work
I'm trying to make an array of books where each book has multiple authors that I can add or remove
I'm trying to learn angular and I've come across a need to have an array nested within another array.
...
0
votes
1
answer
71
views
src/app/reactive-form/reactive-form.component.html:47:48 - error TS2531: Object is possibly 'null'. src/app/reactive-form/reactive-form.component.ts
Object is possibly 'null'. Element implicitly has an 'any' type because expression of type '"controls"' can't be used to index type 'AbstractControl<any, any>'.
Property 'controls' ...
1
vote
1
answer
52
views
Formgroups and FormArray
From data that I recive from API I want to create a reactive form.
I have a formparent and multiple childforms. The data that I want to display in form looks like this:
data{
"...
-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
457
views
Angular Filter FormArray by index
I have a reactive form that is referenced via an accessor, I want to filter it by returning the index that matches the search term from the input field.
ts file
//accessors
get listAccessor() {
...
0
votes
1
answer
286
views
Angular FormArray not detecting inputs for formcontrols of last element
trying to create a formarray of multiple formgroups, the issue I am facing is kind of strange,
the formcontrols present in last element of formarray , is not taking input values
add-modules.ts file
...
0
votes
1
answer
56
views
How strings' array into FormArray Angular
I have array (gifts) of objects, after filled valid form by user, I want to check which checkboxes are checkIn, next push name of selected gifts into giftsArr and on submit-action push into gifts ...
1
vote
1
answer
2k
views
Why is FormArray value not updated when I edit input field?
I have angular reactive form consisting of few FormControl and one FormArray element.
competitionForm!: FormGroup;
this.competitionForm = new FormGroup({
name: new FormControl(this....
0
votes
1
answer
862
views
Angular FormArray setValidators does not work when setting dynamically
I have a formGroup which has a formArray, which contains of {key: '', value: ''} formGroups. I want to make the value formControl to be required when the key formControl is not empty. I have ...