user5508867
user5508867

Reputation:

Angular 6 Form Validation - Cannot read property 'name' of undefined

I seem to be missing something in my code. Please assist! In my browser console, I'm seeing "Cannot read property 'name' of undefined"

HTML Component HTML PORTION

COMPONENT.ts File component

ERROR MESSAGE Console Error

Upvotes: 1

Views: 1186

Answers (3)

Akash Bagali
Akash Bagali

Reputation: 21

in routing module you probably missed out routing conf check it once, as i got the same problem add {path:'new', component : RecipeEditComponent} in recipe children

Upvotes: 1

VIJETHA A G
VIJETHA A G

Reputation: 1

use this in component.ts file import { ReactiveFormsModule } from '@angular/forms'... bczz you used rectiveform method in html code

Upvotes: 0

User3250
User3250

Reputation: 3423

You forgot to define reference #f to your form, change as below:

<form [formGroup]="newUserForm" #f="ngForm" (ngSumbit)="createUser()">

Upvotes: 1

Related Questions