Requiring a checkbox to be checked

I want a button to be disabled until a checkbox has been checked using a FormBuilder for Angular. I don't want to explicitly check the value of the checkbox and would prefer to use a validator so...

Angular 2 form validation, minLength validator is not working

I have following Angular 2 form: <register> <form [ngFormModel] = "registrationForm"> <div class = "form-group"> <label class = "control-label" for="email">Email</label> <input class =...

Reactive Forms - mark fields as touched

I am having trouble finding out how to mark all form's fields as touched. The main problem is that if I do not touch fields and try to submit form - validation error in not shown up. I have...

No value accessor for form control

I'm using Angular2-rc5, and I'm currently getting an error on my login page. I'm trying to make a form but the console throws exceptions telling me that it can't find my formcontrolls even though...

Angular2: Keep getting a 400 bad request error when posting to API but when using a RestClient I get a 200 Ok

I am busy with a small web app where I am trying to post to a API using a RestService but keep getting a 400 bad request. When I do the exact same post using the Insomnia Rest client I get a 200...

Rendering a JSON form using jQuery formbuilder

I want to use jQuery formbuilder (https://formbuilder.online/docs/) and want to render the JSON form generated by Formbuilder on my web page. Can someone help to show how I can achieve this with...

How to read form values in controller?

I am beginner in Angular 2 and I am trying get a value of textbox in component and I really don't know how to get it. HTML : <form [formGroup]="regForm" > <label...

Reducing memory utilization of Angular app

I've created a simple Angular app with one Form and a Table (PrimeNg DataTable). Just to get a substantial difference in memory utilization with initial and final readings, I performed multiple...

Route Resolver not firing observable without subscribe

I have a route which needs some data from my Firebase db before the route is loaded. It feels like the Route is not calling subscribe so the request is never being fired off. Am I missing a...

ngSubmit not working

I have an angular 4 form where I am trying to submit data HTML Code <form class="form-horizontal" [formGroup]="signupForm" (ngSubmit)="onFormSubmit()" > <fieldset> <legend>Scheduler</legend> ...

Angular 7 and Angular Material table with data source error when generating drop list form control for each row

Based on this question on stack, I need to bind a drop down list, for each row generated from angular material table dataSource. The drop down list should select automatically the correspondent...

error TS2742: The inferred type of 'username' cannot be named without a reference to '.../node_modules/@angular/forms/forms'

forgot-password.component.ts(44,7): error TS2742: The inferred type of 'username' cannot be named without a reference to '.../node_modules/@angular/forms/forms'. This is likely not portable. A...

How to send contact form details to email in angular 6?

I am using a contact form in my application.In this i am sending the contact form details on a particular email id. All this i have to do in angular 6. I have tried this using nodemailer but not...

How to set dynamic value to formControl in angular 7

I have a drag-and-drop formBuilder we can able to create form using drag and drop so now i am facing problem i have hidden field in html which is TempleteJson. Here is html code <form...

Angular form builder vs form control and form group

Is there any advantage of using form control and form group over form builder? I have seen here that: The FormBuilder provides syntactic sugar that shortens creating instances of a FormControl,...

Angular - error TS2345: Argument of type 'NgForm' is not assignable to parameter of type 'Ussdthirdpartyapp'

I design an Application using Angular 7 as the frontend and Laravel 5.8 as the backendend. I tested every in the POSTMAN and it works perfectly. I got this error in my...

Jasmine/Angular: Testing the reception of a void EventEmitter onInit?

I'm writing unit testing for one of my components. Said component has a visible boolean, initialized as false. When said boolean property becomes true, the component's display css attribute goes...

Type 'AbstractControl' is missing the following properties from type 'FormGroup': controls, registerControl, addControl, removeControl, and 3 more

we recently upgraded from ng 7.2.15 and typescript 3.2.4 to angular v8.2.14 and typescript v3.5.3. Passing the form group from a parent component to child component is no longer working. Below is...

Angular reactive form custom control async validation

UPDATE: Issue with async validation successfully solved. But there is another issue with initial validation state. See latest answer. Here is the trick: Have component with implemented...

Angular FormBuilder in Pending state when having more than one AsyncValidator

I am trying to add some custom validation to my form in Angular. The problem is that when I have only one AsyncValidator in the form, everything works as expected, so I change one value and form...

Close modal from child inner component

I have a header component which contains a modal window triggered on click <a (click)="open(content)" class="in">Sign in</a> <ng-template #content let-modal> <button type="button" class="close"...

How to mock a FormBuilder for Angular Component Unit Test

I am working in an Angular 9 project. I have a component that is accepting a formBuilder as an input from a Parent Component. This is my Child component (the one I am testing): export class...

error TS2739: Type 'AbstractControl' is missing the following properties from type 'FormControl': registerOnChange, registerOnDisabledChange

I am a newbie in Angular and following an online course using Angular 10 but stuck at one point. I am trying to implement the Reactive forms. For that, I have added a new component text-input. The...

Export of name 'matAutocomplete' not found

I am unable to understand what went wrong with my code, I imported the modules and still I am getting this error " Export of name 'matAutocomplete' not found" Note: I restarted my IDE compiled...

ngx-codemirror displaying only after click in formarray

I am using @ctrl/ngx-codemirror to input javascript code which is in a form array. But the values in the codemirror is displaying only after i click in the editor. I am aware that we're supposed...

ng-bootstrap: ngb-datepicker initial value with angular reactive form group is not getting set

I am working with ngb-datepicker which is working fine if no initial values or predefined values are set but when trying to use it formControlName or with [(ngModel)] with an existing...

Wagtail form builder: How to preserve query string/url parameter from form page for corresponding landing page?

In a wagtail project with a wagtail form builder [1] the default implementation redirects the user after successful form submission to a landing page [2]. In my somewhat customized implementation...

Angular form group vs form control and form builder in Reactive Forms

I'm new to Angular. I came across the code with three variants. I want to know what difference does these three makes implementing in the Reactive forms(Form group, Form builder, and Form...

User validation not working if made in a different browser, "the server responded with a status of 401 (Unauthorized)"

As most websites, I ask the user to validate his account by sending him an email then redirecting him to my website and modifying the "emailValidation" column in the database. It works fine only...

Property 'fName' comes from an index signature, so it must be accessed with ['fName']

These are my files. I am getting this error can someone help me. Error: src/app/app.component.html:5:123 - error TS4111: Property 'fName' comes from an index signature, so it must be accessed with...