Error "Can't bind to 'formGroup' since it isn't a known property of 'form'" in Angular
Hello, colleagues! I'm new to Angular (version 14) and trying to create a simple reactive form, but I've encountered an unclear error. Here's my component code:
```typescript
// my-form.component.ts
import { Component } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
@Component({
selector: 'app-my-form',
templateUrl: './my-form.component.html'
})
export class MyFormComponent {
myForm = new FormGroup({
name: new FormControl(''),
email: new FormControl('')
});
}
```
And the template:
```html
No answers yet.
Log in to leave an answer
Blogs