Questions tagged angular-reactive-forms

Explore the latest questions and answers asked by our top developers.

Angular 9 Reactive Form – Removing the last control and get Valid on Form

Im looking to resolve this issue but i didn’t find a solution, i was looking in lot of topics but nothing works. -Im removing a form control but when i removed the last form control, the form still with Status="valid" Tried with .clearValidators(); .updateValueAndValidity(); and not works Thank you so much for the help. Regards […]

Handling dynamic number of drop-down inputs in Angular reactive form

New to reactive forms, and currently unable to figure out how to get this to work. I am making a dice roller with a dynamic number of dice, thus the number of inputs depends on a different form. I am getting the right number of inputs to display, but can’t for the life of me […]

Angular Reactive Forms with Bootstrap grid: Part of the view disappears on the side on smaller screens

I’ve been working on a simple reactive form to gather info and make queries to an API. It all works, and displays correctly in my large screen. However, when I try to look at my webpage in dev tool mobile view, the buttons in the form are properly aligned but the rest of the content […]

By Mar
Categorized as angular, angular-reactive-forms, html, view Tagged , , ,

Nested formArray in Angular 10 formGroup

i have problem with angular 10 form. I get two different errors in console: Cannot find control with path: ‘observationDataArray -> 0 -> readArray’ Cannot find a differ supporting object ‘[object Object]’ of type ‘object’. NgFor only supports binding to Iterables such as Arrays. Code snipets below: observation-data.ts export class ObservationData { energyProduct: string; productMeasureUnit: […]

Structure forms using ControlValueAccessors and *ngFor

I need some help on how to think about this problem.. I have checkout component that just init’s a form (public cartForm = new FormGroup({});) and have child components that uses ControlValueAccessors… so the form structure becomes -checkout –address –items the address/costCenter stuff are working.. but in the articles component I have a ngFor for […]

how to write inline if || if in angular

i want to patch a value to formControl but i need to check whether it meet the requirement or not. addCard(sectionItems?: any) { let itemControl ={ ‘name’: [sectionItems ? : ”, Validators.compose([Validators.required])], ‘code’: [sectionItems ? sectionItems.code : ”, Validators.compose([Validators.required])], ‘url’: [sectionItems ? sectionItems.url : ”, Validators.compose([Validators.required])], ‘materialSlug’: [sectionItems ? sectionItems.material.slug : null, Validators.compose([Validators.required])], […]

By naoval
Categorized as angular, angular-reactive-forms, json Tagged , ,

Disable copy paste in textbox Angular9

I have my input Textbox like below. User should not be allowed to perform copy paste in the Textbox. But somehow my code is not working. Is there any other approach? <input type="text" class="form-control" id="startTextbox1" appOnlynumber onkeypress=’validate(event)’ onCopy="return false" onDrag="return false" onDrop="return false" onPaste="return false" formControlName="startTextbox1"> I have also written custom directive like it specified […]

Angular cannot find control with FormGroup when using an array of FormGroups

My aim is to create dynamic forms that I allow my users to create. They create a JSON file which describes the form which I then load. These forms can be quite complex (including external links to download key value pairs etc). For the formatting I decided to load the fields from a JSON file […]

By Ursus Schneider
Categorized as angular, angular-reactive-forms Tagged ,

How to validate Template-Driven-Forms on children components in angular

I am working on Angular 10. Its been 3 days that I have a problem with angular template-driven and reactive forms. What I want to do: Create a complex form with many child components (in order to separate lot of code). Then on one button click I want to validate all the form and the […]

FormControl not updating state pristine/dirty or value after making changes to form

Angular newbie here The Problem I am using this library to create a crontab expression generator. The directive has been imported into a page with another existing form. I was able to run the custom directive just fine, and it works perfectly. On clicking the options and inputs, it is generating the correct cron tab […]

1 94 95 96 97 98 102

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us