I have an angular date picker within a reactive form with a required validator. The problem is that it is always not valid, even when a date is picked. Strangely the control does not display red when it is invalid. Do I need to do some manual css rules for this? HTML and Typescript below. A stackblitz of the issue
Tag: angular-forms
Error: Expected a validator to return Promise or Observable
I’m trying to do custom validation on Angular 10 but I’m facing the following error. I just want to return an error to the form if the value doesn’t match the required, here’s my code: This is the component where my form is Does that type of validation only work with observables or can I do it without being a
Matselect default values based on radiobuttons
I have three matformfields named Form A,Form B,Form C and three mat radio buttons named A,B,C. What I want is that when radiobutton A is enabled or checked Form A’s default value should be A and in other two form fields there should be no value by default. When radiobutton B is enabled or checked Form B’s default value should
Angular – Speed up filtering and display of *ngFor
I have a list of users (at the moment about 450) which I filter using a onValueChanges subscription and javascript filter method. It seems pretty slow. I believe it should be quicker but am unsure if it is the actual filtering of the object or the rerendering the html that is slow. When I recreated it in stackBlitz it is
Angular 2: Form submission canceled because the form is not connected
I have a modal that contains a form, when the modal is destroyed I get the following error in the console: Form submission canceled because the form is not connected The modal is added to a <modal-placeholder> element which is a direct child to <app-root>, my top level element. What’s the correct way to removing a form from the DOM