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
2
answers
17k
views
(Angular 5) Error: Cannot read property 'setValue' of undefined
I'm initializing my form this way, but when I need to edit it, it does not accept the values
component.ts
ngOnInit() {
this.tinvoiceService.initForm();
}
tinvoice.service.ts
form: FormGroup;
...
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 ...
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 ...
2
votes
2
answers
9k
views
Angular Reactive Form - How to use FormArray with FormGroup(s)
I am trying to mimic my model in my reactive form. I've set up a few FormGroups to "nest" things that make sense according to my model. I'm having trouble setting up my component to read the ...
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
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
votes
1
answer
38
views
How to handle the Formarray in the Nested array in Angular
enter image description here
I need to render the Dynamic fields in the Angular. But, that one is solved. Then what the issue is when i render the Nested Array or a Group it's not rendering properly.
...
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 ...
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 ...
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
1
answer
248
views
Angular 17 - How to add errorStateMatcher to Form Array, but one that traverses formGroups at consecutve indices
the below code works,
https://stackblitz.com/edit/stackblitz-starters-wnququ?file=src%2Fmain.html
But I need to take it a step further and ensure that the end date of the FormGroup at index (x) is not ...
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 ...
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<...
1
vote
1
answer
749
views
primeng p-table filter with editable FormArray - FilterService Value getting null
I'm facing an issue while implementing filter on primeng p-table with formarray controls, Filter didn't work properly, So registered custom filter and tested then the value is null for all the rows, ...
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: [''...
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
61
views
Angular Input value is not changing in FormArray
I have a FormArray in PreprocesssingForm. Here, Sequence No is not getting changed when I add a new row.
<tr class="mat-row" *ngFor="let dynamic of PreprocessingForm.controls....
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 ...
6
votes
3
answers
10k
views
Detect changes of FormArray children
I have a FormArray with different FormControl items inside it.
I want to be able to listen to the change event of any of them.
I tried to do this:
this.form = this.fb.group({
items: this.fb....
3
votes
1
answer
2k
views
Form components of FormArray in mat-table not sorting properly
I have a mat-table with form control components in each row like image below:
and the data model like below:
export class ProductClass {
constructor(
public id: string,
public name: string,
...
0
votes
1
answer
196
views
Angular FormArray: Removing Selected Items Leaves Undefined Values
I'm encountering an issue with an Angular application where I have a FormArray representing a list of selected items. When I select items from a list and then deselect them, undefined values are left ...
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{
"...