500 questions
0
votes
0
answers
50
views
How to make dynamic validations using ng-content/templateOutlet?
The problem is this: I'm trying to do something similar to what from react-admin (https://marmelab.com/react-admin/Datagrid.html) does, but for Angular. The idea is to be able to use a table on a ...
2
votes
2
answers
174
views
Angular FormControlName vs NgModel Binding
I have a general question using Angular's FormgroupName or NgModel. The Docs I am reading say NgModel was deprecated in Version 6, but it is still available in 17/18, today's current version. The ...
0
votes
1
answer
28
views
Using FormArray and FormGroups I can't get the selected value of a select list
I'm working on a solution where I have a table grid that allow users to add and remove items from the table. Inside of each row are select columns that represent states, cities and mlb teams. I'm ...
0
votes
2
answers
139
views
Angular how to add Enum to a FormGroup as FormControl?
help is appreciated and thanks in advance for all solutions. I created a FormGroup and want via loop adding FormControls to a FormGroup. This tutorial is from Matt Thornton building a real site with ...
1
vote
1
answer
449
views
Type 'FormGroup<{ name: FormControl<string | null>; }>' is not assignable to type 'FormGroup<IForm>'. Types of property 'controls' are incompatible
I am working on Angular 14, Typescript 4.7, Angualr/forms: 14.3.0.
Below is a minimum error reproducible code snippet.
import { Component } from '@angular/core';
import { FormBuilder, FormControl, ...
1
vote
1
answer
362
views
Angular Reactive Form - Get 'formDirective is null' error
This is my form:
<div class="container">
<form formGroupName="checkoutForm">
<section>
<div class="row">
<div class=&...
0
votes
1
answer
76
views
Type mismatch creating an angular FormGroup using a custom FormGroup
I want to be able to define my own methods for a custom angular FormGroup. So I created a class that extends the default angular formgroup, and I want it to be of the same type as IUnitForm
initForm():...
0
votes
1
answer
70
views
how to use child components with parent component - angular
I created this component called country-flag-dropdown.ts and html
Component:
import {Component, OnInit, Input, Output, EventEmitter} from "@angular/core";
import {FormGroup, FormControl} ...
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 ...
0
votes
1
answer
48
views
Generate option for dynamically generated dropdown in angular
I'm creating form dynamic form control using this code
this.fieldsData.forEach((ele, i) => {
if(ele?.inputType=='dropdown')
{
const splitValues =ele?.inputValues.split(',');
...
0
votes
1
answer
75
views
How to correctly transfer Children to the Angular Directive
I'm trying to pass all FormGroups that are in childrens to my directive. Why are they not transmitted?
I tried using @ViewChildren and @ContentChildren but the result is undefined
<div block="...
2
votes
2
answers
235
views
Angular's typed union type FormGroup
I have an application in which user is choosing the value from dropdown and based on choosed value, type of FormGroup will be used. This formGroup is used as "additional informations"
I use ...
2
votes
1
answer
56
views
ion-searchbar with FormGroup to only search when the value inserted is minLength (3)
I'm trying to make a that don't search until the inserted value is higher or equal than 3
but the method i try didn't work
:(
Home.page.html
<form [formGroup]="search">
<ion-...
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,...
0
votes
0
answers
73
views
How to reset radio buttons on reactive forms in angular 14
In my application, I need to reset input type radio button on cancel button click in reactive forms.
<form [formGroup]="form1">
<button click="save()">save</button&...
1
vote
1
answer
59
views
How can I show a value different from what is written in the backend using Record
I have this HTML
<drop-down-list
[name]="MeetingTool.Type"
[options]="options$"
[isRequired]="false" class="input-...
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 | ...
0
votes
1
answer
1k
views
Angular - Error RangeError: Maximum call stack size exceeded. after removing distinctUntilChanged() from a fromControl value change subscription
I have two angular components a parent and a child, both with their own form fields.
I setup change listeners in both components to listen to the form control value changes and disable some fields ...
-1
votes
3
answers
2k
views
Angular Reactive Form - Validation is not working in formGroup
I have this form group defined
get createItem(): FormGroup {
return this.formBuilder.group({
name: ['', Validators.required],
email: ['', Validators.required],
mobile: ['', ...
1
vote
0
answers
43
views
Angular Edit 400 status Crud
hello guys i have problem using angular spring boot ,
For spring boot : backend
when i try to make edit request using spring boot without puting the id i got status 500 , so i add the id using swagger ...
0
votes
1
answer
206
views
Why does the form input value is inconsistent when disabled?
I am currently working on an Angular input component in StorybookJS. The problem that I am facing is that when I type a value (e.g., hello) in the control panel in storybook js and click disabled to ...
0
votes
1
answer
167
views
angular formcontrol type does not match the interface?
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { FormGroup, FormControl, Validators } from '@angular/forms';
export interface ...
0
votes
1
answer
450
views
How to set id for each filed in form group?
I'm using angular and I need check id of each input. Is there any way to set id form each form input like this?
this.contactForm = this.formBuilder.group({
firstname: ['', {id: 1}],
lastname: ['', ...
-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
2
answers
290
views
Anglar 16 MatTable trackBy on FormGoup to detect pristine fields
I have a MatTable with a datasource composed of AbstractControls (FormGroups) for an editable table with action buttons at the end of the line to save or delete each element.
I would like to trackBy ...