224 questions
2
votes
2
answers
50
views
Angular Reactive Form still includes empty values in form.value even after applying validators
I'm using a
Angular 20 with Reactive forms. Even after applying Validators.required to some controls, the form still includes empty string ("") or Null values when I log or submit form.
I ...
1
vote
1
answer
60
views
Angular FormBuilder with spread operator on object with arrays has FormControls of the wrong type
I'm using the Angular FormBuilder (import { FormBuilder } from '@angular/forms';) to create my FormGroup and inner FormControls as this right now:
formGroup = new FormBuilder().nonNullable.group({
....
0
votes
0
answers
182
views
Form.io hide Component tabs like API, Conditional, Logic and Layout tabs
I am working on the form.io from builder integration part. I am not able to hide API, Conditional, Logic and Layout Tabs.
I am using angular JS version 1. Here i have added default configuration for ...
1
vote
1
answer
235
views
How to integrate an Angular 16 application into an existing AngularJS (v1.x) application?
I am working on a project that currently uses AngularJS (v1.x). We want to slowly migrate some parts of it to Angular 16 without doing a complete rewrite at once. Specifically, I want to call a ...
1
vote
1
answer
52
views
How do I bind an Angular reactive form selectbox field to the attribute in the underlying component?
The values of my selectboxes in my reactive form are not binding to the component's formcontrol.
Here I have a date element that I expect to populate the deliveryDate field but the it is not populated:...
0
votes
1
answer
314
views
Angular Form: Run Function on Field Touch, Not Just on Value Changes
I'm working on a form in Angular, and I need to determine if every invalid field has also been touched. This is to provide visual feedback to the user. I currently have a function that checks for ...
0
votes
1
answer
107
views
My mat-form-field doesn't work unless it has a ngIf attribute even though it's redundant
I've been tasked to migrate a project that's using Angular v9 to Angular v17 and everything's been smooth so far without having to change much, but I've encountered a really weird bug and I can't find ...
0
votes
1
answer
132
views
How to dynamically add additional formControls via template outlet?
So, I have the issue that I have a base component that has a form. But I would like to be able to add another field to it. Why? Because I have four pages, with a very similar structure, that differ ...
0
votes
1
answer
412
views
Get current value of an Angular 17 FormBuilder field not reflecting actual value
I'm building a string of text in my template from multiple sources. Each of the fields fires it's own change event successfully, but I'm trying to get the value of the constraint field from within the ...
0
votes
1
answer
283
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: [''...
-1
votes
2
answers
254
views
strike on subscribe while coding in angular. Its says depreciated on hover [duplicate]
I am still figuring out angular. I am working a form to post user details. The form is working and i can see the values in database. Problem is i see a strike on subscribe and on hover it shows the ...
0
votes
0
answers
45
views
Build Angular form with two formarrays nested inside each other
I am building Angular form with two formarrays nested inside each other.
I have an API enpoint that expects a JSON file whose structure is defined from three custom types.
Here are these three custom ...
0
votes
1
answer
368
views
Angular Type assertion doesn't happen for FormGroup when used as Input
I have multiple forms in different components. I am using formBuilder to create my formGroups for typed forms. When I am passing the created formGroups to a child component through @Input, I don't see ...
2
votes
1
answer
972
views
Angular updateValueAndValidity() doesn't work
I have simple form:
<form [formGroup]="form" (ngSubmit)="onSubmit()" novalidate>
<input type="radio" id="enabled" formControlName="enabled"
...
0
votes
1
answer
353
views
Angular Typed Forms & Validators | Case Example
Let's assume having a simple form like this:
return this.formBuilder.group({
myNumber: this.formBuilder.control<number | null>(
null,
Validators.required
)
});
The control ...