We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
Thanks, nice and clean explanation :-)
Hi, Thanks for the explanation. In the latest angular, getting the below exception.
Property 'angForm' has no initializer and is not definitely assigned in the constructor.ts(2564)
Can you please help me how to fix it.
import { Component } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Angular Form Validation Tutorial';
angForm: FormGroup;
submitted = false;
constructor(private fb: FormBuilder) {
this.angForm = this.fb.group({
name: ['', Validators.required ],
address: ['', Validators.required ]
});
}
}
Working fine, after updated as above. Thanks.
save my day.<3