2,129 questions
1
vote
1
answer
131
views
How to provide default values for individual fields in Angular 21 Signal Forms (without UI flicker) when implementing a FormValueControl?
We're starting to look at Angular 21's new signal-based forms, but I can't find a clean way to define default values for each form field, especially when building forms for objects where multiple keys ...
2
votes
2
answers
65
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 ...
2
votes
0
answers
67
views
Form not updated when Browser auto-fills saved email/password until user interaction [duplicate]
I have a login form in Angular 16 with FormGroup validation.
When I open the login page in Chrome, the browser auto-fills the saved email and password fields. The values are visible in the input ...
1
vote
1
answer
40
views
how to detect formly toggle field type is disabled?
I have a formly form with toggle field, I would like to detect when the user clicks on the toggle to disable it.
here is what I have done so far:
fields: {
key: myToggle,
...
0
votes
1
answer
86
views
How to save data from multiple forms on button click function? [closed]
I have succeeded in creating multiple forms based on the value from the dropdown list, but I am not able to save the data from the input element into database. If my dropdown list displays the value 5,...
0
votes
1
answer
86
views
Create a new FormGroup with FormControls using a generic type
I am working on an Angular component that manages a list of FormGroups. This list can be expanded and items can be deleted.
But I also want the component to handle any kind of FormGroup. So for ...
2
votes
1
answer
94
views
How to handed a relationship between two signals by linkedSignals in Angular v20?
I have to mange a relation for X*2=Y, there Y and Y are input fields.
In the moment, I trigger by a change of the input field the related variable as
X changed => Y=X*2
Y changed => X=Y/2
import ...
1
vote
1
answer
59
views
SetValue is not triggering Dropdown's (change) function
In Angular 19, I need a function to run when a dropdown changes value. However, it doesn't happen when using setValue.
html
<select id="dropdown" [formControl]="dropdown" (...
1
vote
1
answer
75
views
Angular Test harness not setting ngModel variable in MatSelect
Using MatSelect and working on UTs.
Post selecting a option via test harness, not able to see ngModel variable binding working.
Here is the html snippet:
<mat-form-field class="dropdown-...
2
votes
1
answer
177
views
how to search in signal list in angular
I have a list of signal type.
searchModelDriver: string = '';
driverList = signal<any[]>([
{ fullName: 'test1' },
{ fullName: 'test2' },
{ fullName: 'test3' },
])
I also have a ...
1
vote
2
answers
98
views
What is the relationship of NG_VALUE_ACCESSOR, ControlValueAccessor interface in angular?
What is the relationship of NG_VALUE_ACCESSOR, ControlValueAccessor interface in angular?
Is if I have the following statement (provide:NG_VALUE_ACCESSOR)
@Component({
selector: 'rm-header',
...
1
vote
1
answer
57
views
How to reorder items in FormGroup?
I have element in a FormGroup, let say
const langs = ['en', 'de']
form = new FormGroup({
languages: [langs, [Validators.required]]
descriptions: initChildGroup(langs)
})
initChildGroup(langs) {
...
2
votes
1
answer
46
views
How to save the value of textbox with dynamic route data into database?
Tagid and typename textboxes are currently holding routed values from customer component, but are not being saved into the database when I clicked on save button. In other words, routing the dynamic ...
1
vote
2
answers
81
views
Dynamic custom component radio buttons do not have unique name when duplicated
I have the following form with a set of radio buttons in each section I can only select one of the buttons at any given time.
It appears that they do not have unique names.
The form is dynamically ...
2
votes
2
answers
647
views
Why does my Angular dropdown update selection even when the parent does not store the selected value?
I have an Angular dropdown component (CustomDropdownComponent) that receives a list of options and a selected value from its parent component via @Input(). The parent also listens for selection ...
2
votes
1
answer
2k
views
How to set up Angular Reactive Forms with Signals
I have set up a formbuilder with a number of inputs components, each of which uses a control value accessor mixin. Where I've got to is that the input components render OK, the user inputs trigger the ...
2
votes
1
answer
32
views
TypeScript cannot guarantee that the controls I am accessing are of type FormGroup or FormArray in my Angular template. How to change that?
I am trying to build a LMS using Angular but I have some issues with Angular forms. I want to be able to add dynamically modules to a given course but also to add dynamically any sort of the 3 types ...
1
vote
1
answer
80
views
Angular unidirectional data flow and Angular Forms
I’m preparing a presentation on the topic of Angular state management for my colleagues. The main focus of the talk is creating “dumb” components which accept inputs from parent components, render ...
1
vote
4
answers
603
views
Should I use <form> when I use <mat-form-field> while building a Form?
I'm building a form and I'm confused if I should use mat-form-field tag from angular material alone without form tag, or I should wrapp everything with form html tag like the following
<form>
&...
-1
votes
1
answer
576
views
Fill form with URL parameters in Angular 19
I have a form and researching here discovered a way to check whether the form is valid or not and to put your data in the URL when submitted. However, if you open another page with the parameters in ...
1
vote
1
answer
258
views
Angular 19: Implement Directive like FormControlName
I want to implement my own Property directive which should act similar to the existing FormControlName directive.
It should use the name of the given Property to act as if it where given as ...
0
votes
0
answers
47
views
Multiple validation is not working properly in template driven form
I having issue multiple validation is not working properly. For example validate1 method checking input is empty or not , validation2 method checking name1 and name2 value are equal or not equal. ...
1
vote
1
answer
261
views
Angular form async validator firing but not updating form validity
This is my first time trying an async form validator. It is attached at to my form's asyncValidators, it's firing appropriately, the correct value (object or null) is being returned ... but the form ...
2
votes
1
answer
119
views
How to merge validation error of matDatepicker and parent form
I'm currently building custom month picker component using the Datepicker from angular material library.The month picker should be able to use with reactive form like this.
app.component.ts
form = ...
0
votes
0
answers
66
views
Angular forms not recognizing formControlName
I'm building a form which on the top contains filters. I'll show the functions that are called when the error ocurrs
public onChangeSubType(requestSubType: any) {
const typeId = this.filterFormGroup....