We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Dom King • 4 years ago

save my day.<3

Ravi Lorenzo Mengoni • 5 years ago

Thanks, nice and clean explanation :-)

Paramesh K • 2 years ago

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.

Paramesh K • 2 years ago

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 ]
});
}
}

Paramesh K • 2 years ago

Working fine, after updated as above. Thanks.