Questions tagged [angular-formbuilder]

The FormBuilder provides syntactic sugar that shortens creating instances of a FormControl, FormGroup, or FormArray. It reduces the amount of boilerplate needed to build complex forms.

See the angular docs for more information

165 questions
0
votes
1 answer

Binding JSON data to a Reactive Form

I came across the following Stackblitz demo : https://stackblitz.com/edit/angular-dffny7?file=app with reference to the below post: https://stackoverflow.com/a/48527939/7429196 Now suppose I have the following JSON { "companies": [ { …
0
votes
1 answer

Dynamic Form Creation in angular 6

I am trying to get started with creating a dynamic form in Angular 2, and I am using the setup from the Angular documentation . I didn't have any issues with their setup, which just hard codes the data in the service as apposed to an api call. My…
sireesha j
  • 543
  • 2
  • 5
  • 22
0
votes
1 answer

How to create nested nested reactive forms?

I am trying to create a reactive form which will display details on the page about meetings, the labels are dynamic and returned from an API. Here is a sample of the data returned. const meetings = [ { id: 1, date: '06/07/2018', …
0
votes
2 answers

How to create a custom validator for FormGroup

I have a formGroup object with 6 fields. 5 fields out of the 6 are collectively mandatory, meaning either one of them has to have a value for it to be a valid form. It does not matter which one of the 5 fields has a value as long as one of them has…
matchifang
  • 3,889
  • 8
  • 36
  • 60
0
votes
1 answer

Angular 5: nested form control within form group within form array

I'm having trouble referring to a formControlName within a formGroup within a formArray. The structure of my formGroup within my formArray is as follows: const marketingFileFormGroup = this.fb.group({ file: [], fileName: [], …
Shaun Chua
  • 537
  • 1
  • 10
  • 24
0
votes
1 answer

Angular Reactive Forms validations

I have a form with 3 inputs, 2 of the inputs are required and the third isn't. My problem is that when I go the page of the form I see that the field that isn't required is in a valid state and is already colored with green, even tho the field…
0
votes
0 answers

Angular FormArray and Duplicates

Do Angular FormArray allow duplicates as its values. Bcoz as i am seeing in my code formArrays is rejecting the repeated values and only taking unique once.If above is the case, what is the work around for this?
bharath bhushan
  • 105
  • 1
  • 8
0
votes
0 answers

Cannot read property 'prodid' of undefined at ClientEditComponent.updateClient

I have a Component named as "Client Component" using firebase for database purposes, material component for design purpose. I am working on CRUD operations i did create, delete but facing an issue in Update. The Client data show in grid and when i…
-1
votes
1 answer

can we check form is disabled or not in angular reactive form?

I am using the reactive form in my angular9 for form validation. now I need to hide the submit button which is percent outside of this form, if the form is disabled(all the field in the form is disabled). is there any variable or method percent in…
Nishil S.B
  • 11
  • 6
-1
votes
1 answer

Getting some warning messages while building thr angular application

I am getting the following error while building the angular application using the command ng build --prod. Error: edit.component.html(111,50): Property 'controls' does not exist on type 'AbstractControl'. edit.component.html(113,54): Property…
user_agent
  • 65
  • 6
-1
votes
2 answers

What is the difference between FormControl init methods?

What is the difference between below methods: input: new FormControl({}, inputValidatorFn()) input: [{}, inputValidatorFn()] input: formBuilder.control({}, inputValidatorFn()) It seams to behave the same. Or there is no difference at all? Example
Adam Michalski
  • 1,619
  • 14
  • 32
-1
votes
1 answer

Angular 6 dynamic form rendering

I want to build a form reading fields from a list of values:
Vitto Lib
  • 45
  • 1
  • 9
-1
votes
1 answer

Need some advice on [formGroup] formGroupName ,[formControl] formControlName

I am looking at the existing answer for question What is the difference between formControlName and FormControl? and still struggle to fully understand when to use [formControl] over formControlName. Am I correct to conclude [ based on @Paul…
-1
votes
2 answers

Show Error if Total Min Value Is Not Equal to Max Value

I need to show the error if the total min value is not equal to the total max value. How will i able to do it? Here's my code and the link below PLEASE CLICK THIS LINK this.total$ = this.inquiryForm.valueChanges.pipe( …
-2
votes
4 answers

Check for same password and confirm password in Angular Reactive Form - FormBuilder

I'm trying to create Angular 5 registration form with .NET Core. I'm checking whether password and retyped password are the same in the registration form. I'm using FormBuilder for form. But checking password1 and password2 is always failing. I have…
1 2 3
10
11